

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>radmc3dPy package &mdash; radmc3dPy 0.30.2 documentation</title>
  

  
  
  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
        <link rel="index" title="Index"
              href="genindex.html"/>
        <link rel="search" title="Search" href="search.html"/>
    <link rel="top" title="radmc3dPy 0.30.2 documentation" href="index.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> radmc3dPy
          

          
          </a>

          
            
            
              <div class="version">
                0.30.2
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
    
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="requirements.html">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="download.html">Downloads</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial_reggrid_cont.html">Continuum model tutorial (regular grid)</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial_reggrid_line.html">Line model tutorial (regular grid)</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial_octree_grid.html">Octree AMR in radmc3dPy</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial_octree_models.html">Octree AMR models</a></li>
<li class="toctree-l1"><a class="reference internal" href="parfile.html">Parameter file</a></li>
</ul>

            
          
    <a href="py-modindex.html">Modules</a>
    <a href="genindex.html">Index</a>
  
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">radmc3dPy</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
      <li>radmc3dPy package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="radmc3dpy-package">
<h1>radmc3dPy package<a class="headerlink" href="#radmc3dpy-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="radmc3dPy.models.html">radmc3dPy.models package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.lines_nlte_lvg_1d_1">radmc3dPy.models.lines_nlte_lvg_1d_1 module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.ppdisk">radmc3dPy.models.ppdisk module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.ppdisk_acc">radmc3dPy.models.ppdisk_acc module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.ppdisk_amr">radmc3dPy.models.ppdisk_amr module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.simple_1">radmc3dPy.models.simple_1 module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.spher1d_1">radmc3dPy.models.spher1d_1 module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.spher2d_1">radmc3dPy.models.spher2d_1 module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.template">radmc3dPy.models.template module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models.test_scattering_1">radmc3dPy.models.test_scattering_1 module</a></li>
<li class="toctree-l2"><a class="reference internal" href="radmc3dPy.models.html#module-radmc3dPy.models">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-radmc3dPy.analyze">
<span id="radmc3dpy-analyze-module"></span><h2>radmc3dPy.analyze module<a class="headerlink" href="#module-radmc3dPy.analyze" title="Permalink to this headline">¶</a></h2>
<p>This module contains functions to read and write input/output data for RADMC-3D and
to do some simple analysis/diagnostics of the model.</p>
<dl class="function">
<dt id="radmc3dPy.analyze.findContainerLeafID">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">findContainerLeafID</code><span class="sig-paren">(</span><em>cellCRD=None</em>, <em>cellHW=None</em>, <em>xi=None</em>, <em>yi=None</em>, <em>zi=None</em>, <em>childID=None</em>, <em>isLeaf=None</em>, <em>nChild=None</em>, <em>crd=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.findContainerLeafID" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to find the tree index of a leaf cell containing a given point in space, i.e. if the following is true : 
xcell - dxcell &lt;= xpoint &lt; xcell + dxcell for each dimension. This function is to be used in multiprocessing.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>cellCRD</strong> : ndarray</p>
<blockquote>
<div><p>Array with dimensions [ncell, 3] containing the cell centre coordiantes of the tree</p>
</div></blockquote>
<p><strong>cellHW</strong> : ndarray</p>
<blockquote>
<div><p>Array with dimensions [ncell, 3] containing the half width of cells in the tree</p>
</div></blockquote>
<p><strong>xi</strong> : ndarray</p>
<blockquote>
<div><p>Array of cell interface indices in the base grid in the first dimension</p>
</div></blockquote>
<p><strong>yi</strong> : ndarray</p>
<blockquote>
<div><p>Array of cell interface indices in the base grid in the second dimension</p>
</div></blockquote>
<p><strong>zi</strong> : ndarray</p>
<blockquote>
<div><p>Array of cell interface indices in the base grid in the third dimension</p>
</div></blockquote>
<p><strong>childID</strong> : ndarray</p>
<blockquote>
<div><p>Child index array</p>
</div></blockquote>
<p><strong>isLeaf</strong> : ndarray</p>
<blockquote>
<div><p>Boolean array containing the node type for each cell (True - leaf, False - branch)</p>
</div></blockquote>
<p><strong>nChild</strong> : int</p>
<blockquote>
<div><p>Number of children (8,4,2 for 3,2,1 active dimensions)</p>
</div></blockquote>
<p><strong>crd</strong> : ndarray</p>
<blockquote>
<div><p>Array of length 3 containing the coordinates of the point whose container
leaf is to be found</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Tree index of the container leaf if it is found. If the point is outside of the base grid -1 is returned.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.findContainerLeafIDRec">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">findContainerLeafIDRec</code><span class="sig-paren">(</span><em>x=None</em>, <em>y=None</em>, <em>z=None</em>, <em>dx=None</em>, <em>dy=None</em>, <em>dz=None</em>, <em>childID=None</em>, <em>isLeaf=None</em>, <em>nChild=None</em>, <em>crd=()</em>, <em>cellID=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.findContainerLeafIDRec" title="Permalink to this definition">¶</a></dt>
<dd><p>Recursive function to find the leaf cell in the tree that contains a given point in space</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>x</strong> : ndarray</p>
<blockquote>
<div><p>Tree cell center array in the first dimension</p>
</div></blockquote>
<p><strong>y</strong> : ndarray</p>
<blockquote>
<div><p>Tree cell center array in the second dimension</p>
</div></blockquote>
<p><strong>z</strong> : ndarray</p>
<blockquote>
<div><p>Tree cell center array in the tird dimension</p>
</div></blockquote>
<p><strong>dx</strong> : ndarray</p>
<blockquote>
<div><p>Tree cell halfwidth array in the first dimension</p>
</div></blockquote>
<p><strong>dy</strong> : ndarray</p>
<blockquote>
<div><p>Tree cell halfwidth array in the second dimension</p>
</div></blockquote>
<p><strong>dz</strong> : ndarray</p>
<blockquote>
<div><p>Tree cell halfwidth array in the third dimension</p>
</div></blockquote>
<p><strong>childID</strong> : list</p>
<blockquote>
<div><p>List of children indices. Each list element is an ndarray with nChild elements containing 
the child indices</p>
</div></blockquote>
<p><strong>isLeaf</strong> : ndarray</p>
<blockquote>
<div><p>Boolean array for the cell type (True - leaf, False - branch)</p>
</div></blockquote>
<p><strong>nChild</strong> : int</p>
<blockquote>
<div><p>Nr of children (i.e. 8, 4, or 2 for 3, 2, 1 active dimensions, respectively)</p>
</div></blockquote>
<p><strong>crd</strong> : ndarray</p>
<blockquote>
<div><p>Three element list/tuple/array containing the point coordinates</p>
</div></blockquote>
<p><strong>cellID</strong> : int</p>
<blockquote class="last">
<div><p>Index of cell to be tested</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.gdensMinMax">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">gdensMinMax</code><span class="sig-paren">(</span><em>x=None</em>, <em>y=None</em>, <em>z=None</em>, <em>dx=None</em>, <em>dy=None</em>, <em>dz=None</em>, <em>model=None</em>, <em>ppar=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.gdensMinMax" title="Permalink to this definition">¶</a></dt>
<dd><p>Example function to be used as decision function for resolving cells in tree building. It calculates the gas density
at a random sample of coordinates within a given cell than take the ratio of the max/min density. If it is larger
than a certain threshold value it will return True (i.e. the cell should be resolved) if the density variation is 
less than the threshold it returns False (i.e. the cell should not be resolved)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>x</strong> : ndarray</p>
<blockquote>
<div><p>Cell centre coordinates of the cells in the first dimension</p>
</div></blockquote>
<p><strong>y</strong> : ndarray</p>
<blockquote>
<div><p>Cell centre coordinates of the cells in the second dimension</p>
</div></blockquote>
<p><strong>z</strong> : ndarray</p>
<blockquote>
<div><p>Cell centre coordinates of the cells in the third dimension</p>
</div></blockquote>
<p><strong>dx</strong> : ndarray</p>
<blockquote>
<div><p>Half size of the cells in the first dimension</p>
</div></blockquote>
<p><strong>dy</strong> : ndarray</p>
<blockquote>
<div><p>Half size of the cells in the second dimension</p>
</div></blockquote>
<p><strong>dz</strong> : ndarray</p>
<blockquote>
<div><p>Half size of the cells in the third dimension</p>
</div></blockquote>
<p><strong>model</strong> : object</p>
<blockquote>
<div><p>A radmc3dPy model (must contain a getGasDensity() function)</p>
</div></blockquote>
<p><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>All parameters of the problem (from the problem_params.inp file). It is not used here, but must be present 
for compatibility reasons.</p>
</div></blockquote>
<p><strong>**kwargs: dictionary</strong></p>
<blockquote class="last">
<div><p>Parameters used to decide whether the cell should be resolved. It should the following keywords; 
&#8216;nsample&#8217;, which sets the number of random points the gas desity is sampled at within the cell and 
&#8216;threshold&#8217; that sets the threshold value for max(gasdens)/min(gasdens) above which the cell should 
be resolved.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.getDensVstruct">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">getDensVstruct</code><span class="sig-paren">(</span><em>data=None</em>, <em>vmean_temp=False</em>, <em>ispec_tgas=0</em>, <em>gsize=None</em>, <em>idust=None</em>, <em>mstar=None</em>, <em>mu=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.getDensVstruct" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the vertical hydrostatic equilibrium</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data</strong> : radmc3dData</p>
<blockquote>
<div><p>An instance of the radmc3DData class containing the density structure of the model</p>
</div></blockquote>
<p><strong>vmean_temp</strong> : bool</p>
<blockquote>
<div><p>If True (T(z) = T(-z) = 0.5*(T(z) + T(-z))) if False (T(z)!=T(-z))</p>
</div></blockquote>
<p><strong>idust</strong> : list</p>
<blockquote>
<div><p>List of dust indices whose structure must be calculated</p>
</div></blockquote>
<p><strong>mstar</strong> : float</p>
<blockquote>
<div><p>Stellar mass</p>
</div></blockquote>
<p><strong>ispec_tgas</strong> : int</p>
<blockquote>
<div><p>Index of dust species whose temperature is taken to be the gas temperature</p>
</div></blockquote>
<p><strong>gsize</strong> : ndarray, optional</p>
<blockquote>
<div><p>Dust grain sizes - If specified, the gas temperature is calculated as the average temperature
of all dust grains in the grid cell weighted by the total surface area of dust grains with given
size - NOTE: this approach assumes that all dust grains of a given size have the same bulk density</p>
</div></blockquote>
<p><strong>mu</strong> : float, optional</p>
<blockquote>
<div><p>Mean molecular weight (default: 2.3)</p>
</div></blockquote>
<p><strong>Returns</strong></p>
<p><strong>&#8212;&#8212;-</strong></p>
<p class="last"><strong>Returns an ndarray with the dust density</strong></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.gmass">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">gmass</code><span class="sig-paren">(</span><em>x=None</em>, <em>y=None</em>, <em>z=None</em>, <em>dx=None</em>, <em>dy=None</em>, <em>dz=None</em>, <em>model=None</em>, <em>ppar=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.gmass" title="Permalink to this definition">¶</a></dt>
<dd><p>Example function to be used as decision function for resolving cells in tree building. It calculates the gas density
at a random sample of coordinates within a given cell than take the ratio of the max/min density. If it is larger
than a certain threshold value it will return True (i.e. the cell should be resolved) if the density variation is 
less than the threshold it returns False (i.e. the cell should not be resolved)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>x</strong> : ndarray</p>
<blockquote>
<div><p>Cell centre coordinates of the cells in the first dimension</p>
</div></blockquote>
<p><strong>y</strong> : ndarray</p>
<blockquote>
<div><p>Cell centre coordinates of the cells in the second dimension</p>
</div></blockquote>
<p><strong>z</strong> : ndarray</p>
<blockquote>
<div><p>Cell centre coordinates of the cells in the third dimension</p>
</div></blockquote>
<p><strong>dx</strong> : ndarray</p>
<blockquote>
<div><p>Half size of the cells in the first dimension</p>
</div></blockquote>
<p><strong>dy</strong> : ndarray</p>
<blockquote>
<div><p>Half size of the cells in the second dimension</p>
</div></blockquote>
<p><strong>dz</strong> : ndarray</p>
<blockquote>
<div><p>Half size of the cells in the third dimension</p>
</div></blockquote>
<p><strong>model</strong> : object</p>
<blockquote>
<div><p>A radmc3dPy model (must contain a getGasDensity() function)</p>
</div></blockquote>
<p><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>All parameters of the problem (from the problem_params.inp file). It is not used here, but must be present 
for compatibility reasons.</p>
</div></blockquote>
<p><strong>**kwargs: dictionary</strong></p>
<blockquote class="last">
<div><p>Parameters used to decide whether the cell should be resolved. It should contain the following keywords; 
&#8216;nsample&#8217;, which sets the number of random points the gas desity is sampled at within the cell and 
&#8216;threshold&#8217; that sets the threshold value for max(gasdens)/min(gasdens) above which the cell should 
be resolved.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.interpolateOctree">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">interpolateOctree</code><span class="sig-paren">(</span><em>data=None</em>, <em>x=None</em>, <em>y=None</em>, <em>z=None</em>, <em>var=None</em>, <em>nproc=1</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.interpolateOctree" title="Permalink to this definition">¶</a></dt>
<dd><p>Nearest neighbour inteprolation on an octree</p>
<dl class="docutils">
<dt>data <span class="classifier-delimiter">:</span> <span class="classifier">radmc3dData</span></dt>
<dd>Data container</dd>
<dt>x <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Coordiantes of the point to be interpolated on in the first dimension</dd>
<dt>y <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Coordiantes of the point to be interpolated on in the second dimension</dd>
<dt>z <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Coordiantes of the point to be interpolated on in the third dimension</dd>
<dt>var <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Name of the variables to be interpolated, supported names are:
ddens, dtemp, gdens, ndens, gtemp, gvel, vturb</dd>
<dt>nproc <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Number of processes to be used (for parallel computing)</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.plotDustOpac">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">plotDustOpac</code><span class="sig-paren">(</span><em>opac=None</em>, <em>var='kabs'</em>, <em>idust=0</em>, <em>ax=None</em>, <em>xlabel=None</em>, <em>ylabel=None</em>, <em>fmt=''</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.plotDustOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the dust opacity as a function of wavelength</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>opac</strong> : radmc3dDustOpac</p>
<blockquote>
<div><p>Dust opacity container</p>
</div></blockquote>
<p><strong>var</strong> : {&#8216;kabs&#8217;, &#8216;ksca&#8217;, &#8216;kext&#8217;, &#8216;g&#8217;}</p>
<blockquote>
<div><p>Variable to be plotted</p>
</div></blockquote>
<p><strong>idust</strong> : int, optional</p>
<blockquote>
<div><p>Dust index in opac to be plotted (default=0)</p>
</div></blockquote>
<p><strong>ax</strong> : Axis, optional</p>
<blockquote>
<div><p>Matplotlib axis to plot on. If not set the current axis will be used.</p>
</div></blockquote>
<p><strong>xlabel</strong> : str, optional</p>
<blockquote>
<div><p>Label of the x-axis</p>
</div></blockquote>
<p><strong>ylabel</strong> : str, optional</p>
<blockquote>
<div><p>Label of the y-axis</p>
</div></blockquote>
<p><strong>fmt</strong> : str, optional</p>
<blockquote>
<div><p>Format of the plotted line. The same as the third non-keyword argument of matplotlib.pyplot.plot()</p>
</div></blockquote>
<p><strong>Keyword Arguments:</strong></p>
<blockquote>
<div><p>Any further keyword argument that will be passed to matplotlib.pyplot.plot()</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The returned list by matplotlib.pyplot.plot()</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.plotScatmat">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">plotScatmat</code><span class="sig-paren">(</span><em>opac=None</em>, <em>var='z11'</em>, <em>idust=0</em>, <em>iwav=None</em>, <em>wav=None</em>, <em>xvar='ang'</em>, <em>iang=None</em>, <em>ang=None</em>, <em>ax=None</em>, <em>xlabel=None</em>, <em>ylabel=None</em>, <em>title=None</em>, <em>fmt=''</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.plotScatmat" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the scattering matrix elements either as a function of scattering angle at a specific wavelength (default)
or as a function of wavelength at a specific scattering angle</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>opac</strong> : radmc3dDustOpac</p>
<blockquote>
<div><p>Dust opacity container</p>
</div></blockquote>
<p><strong>var</strong> : {&#8216;kabs&#8217;, &#8216;ksca&#8217;, &#8216;kext&#8217;, &#8216;g&#8217;}</p>
<blockquote>
<div><p>Variable to be plotted</p>
</div></blockquote>
<p><strong>idust</strong> : int, optional</p>
<blockquote>
<div><p>Dust index in opac to be plotted (default=0)</p>
</div></blockquote>
<p><strong>iwav</strong> : int, optional</p>
<blockquote>
<div><p>Wavelength index (used only if xvar=&#8217;ang&#8217;) to be plotted.</p>
</div></blockquote>
<p><strong>wav</strong> : float, optional</p>
<blockquote>
<div><p>Wavelength at which the plot should be made (used only if xvar=&#8217;ang&#8217;). In practice, instead of
interpolating to this wavelength, the nearest wavelength in the wavelength grid will be used.</p>
</div></blockquote>
<p><strong>xvar</strong> : {&#8216;ang&#8217;, &#8216;wav&#8217;}</p>
<blockquote>
<div><p>Variable for plotting the scattering matrix elements against (default=&#8217;ang&#8217;)</p>
</div></blockquote>
<p><strong>iang</strong> : int, optional</p>
<blockquote>
<div><p>Scattering angle index (used only if xvar=&#8217;wav&#8217;)</p>
</div></blockquote>
<p><strong>ang</strong> : int, optional</p>
<blockquote>
<div><p>Scattering angle in degrees at which the plot should be made (used only if xvar=&#8217;wav&#8217;).
In practice, instead of interpolating to this scattering angle, the nearest angle in the angular
grid will be used.</p>
</div></blockquote>
<p><strong>ax</strong> : Axis, optional</p>
<blockquote>
<div><p>Matplotlib axis to plot on. If not set the current axis will be used.</p>
</div></blockquote>
<p><strong>xlabel</strong> : str, optional</p>
<blockquote>
<div><p>Label of the x-axis</p>
</div></blockquote>
<p><strong>ylabel</strong> : str, optional</p>
<blockquote>
<div><p>Label of the y-axis</p>
</div></blockquote>
<p><strong>title</strong> : str, optional</p>
<blockquote>
<div><p>Title of the plot. If not set either the wavelength (for xvar=&#8217;ang&#8217;) or the scattering angle
(for xvar=&#8217;wav&#8217;) the plot was made at.</p>
</div></blockquote>
<p><strong>fmt</strong> : str, optional</p>
<blockquote>
<div><p>Format of the plotted line. The same as the third non-keyword argument of matplotlib.pyplot.plot()</p>
</div></blockquote>
<p><strong>Keyword Arguments:</strong></p>
<blockquote>
<div><p>Any further keyword argument that will be passed to matplotlib.pyplot.plot()</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The returned list by matplotlib.pyplot.plot()</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.plotSlice2D">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">plotSlice2D</code><span class="sig-paren">(</span><em>data=None</em>, <em>var='ddens'</em>, <em>plane='xy'</em>, <em>crd3=0.0</em>, <em>icrd3=None</em>, <em>ispec=-1</em>, <em>xlim=()</em>, <em>ylim=()</em>, <em>log=False</em>, <em>linunit='cm'</em>, <em>angunit='rad'</em>, <em>nx=100</em>, <em>ny=100</em>, <em>showgrid=False</em>, <em>gridcolor='k'</em>, <em>gridalpha=1.0</em>, <em>nproc=1</em>, <em>contours=False</em>, <em>clev=None</em>, <em>clmin=None</em>, <em>clmax=None</em>, <em>ncl=None</em>, <em>cllog=False</em>, <em>clcol='k'</em>, <em>cllabel=False</em>, <em>cllabel_fontsize=10</em>, <em>cllabel_fmt='%.1f'</em>, <em>clalpha=1.0</em>, <em>ax=None</em>, <em>lattitude=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.plotSlice2D" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to plot an axis-aligned 2D slice of the variables in the model. Any additional keyword
argument above the listed ones will be passed on to matplotlib.pylab.pcolormesh(). For an octree grid the variables 
are interpolated onto a regular grid using nearest neighbour interpolation before plotting. 
The size and resolution of the regular image grid can be set at input.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>data</strong> : radmc3dData</p>
<blockquote>
<div><p>Instance of radmc3dData containing the field variable to be displayed</p>
</div></blockquote>
<p><strong>var</strong> : {&#8216;ddens&#8217;, &#8216;dtemp&#8217;, &#8216;gdens&#8217;, &#8216;ndens&#8217;, &#8216;gtemp&#8217;, &#8216;vturb&#8217;, &#8216;vx&#8217;, &#8216;vy&#8217;, &#8216;vz&#8217;, &#8216;taux&#8217;, &#8216;tauy&#8217;}</p>
<blockquote>
<div><p>Variable to be displayed</p>
</div></blockquote>
<p><strong>plane</strong> : {&#8216;xy&#8217;, &#8216;xz&#8217;, &#8216;yz&#8217;, &#8216;yx, &#8216;zx&#8217;, &#8216;yz&#8217;}</p>
<blockquote>
<div><p>Plane to be displayed</p>
</div></blockquote>
<p><strong>crd3</strong> : float</p>
<blockquote>
<div><p>Coordinate of the third dimension (i.e. when plotting a slice in the x-y plane, crd3 is the 
z-coordinate)</p>
</div></blockquote>
<p><strong>icrd3</strong> : int</p>
<blockquote>
<div><p>Index of the third coordinate in the grid (only for regular grid!)</p>
</div></blockquote>
<p><strong>ispec</strong> : int</p>
<blockquote>
<div><p>Dust species index. If negative dust densities will be summed up and the total cumulative density 
will be displayed</p>
</div></blockquote>
<p><strong>xlim</strong> : tuple</p>
<blockquote>
<div><p>Coordinate boundaries in the first dimension of the plot (also the coordinate boundary of the 
regular grid data on
AMR grids are interpolated to)</p>
</div></blockquote>
<p><strong>ylim</strong> : tuple</p>
<blockquote>
<div><p>Coordinate boundaries in the second dimension of the plot (also the coordinate boundary of the 
regular grid data on
AMR grids are interpolated to)</p>
</div></blockquote>
<p><strong>log</strong> : bool</p>
<blockquote>
<div><p>If True the contour/image will be displayed on a logarithmic stretch</p>
</div></blockquote>
<p><strong>linunit</strong> : {&#8216;cm&#8217;, &#8216;au&#8217;, &#8216;pc&#8217;, &#8216;rs&#8217;}</p>
<blockquote>
<div><p>Unit selection for linear image coordinate axes.</p>
</div></blockquote>
<p><strong>nx</strong> : int</p>
<blockquote>
<div><p>Number of horizontal pixels in the interpolated image if the data is defined in an Octree</p>
</div></blockquote>
<p><strong>ny</strong> : int</p>
<blockquote>
<div><p>Number of vertical pixels in the interpolated image if the data is defined in an Octree</p>
</div></blockquote>
<p><strong>showgrid</strong> : bool</p>
<blockquote>
<div><p>If True the spatial grid will be overlayed</p>
</div></blockquote>
<p><strong>gridcolor</strong> : str</p>
<blockquote>
<div><p>Color of the spatial grid overlay</p>
</div></blockquote>
<p><strong>gridalpha</strong> : float</p>
<blockquote>
<div><p>Opacity of the lines in the spatial grid overlay (0.0 - fully transparent, 1.0 - fully opaque)</p>
</div></blockquote>
<p><strong>angunit</strong> : {&#8216;rad&#8217;, &#8216;deg&#8217;}</p>
<blockquote>
<div><p>Unit selection for angular image coordinate axes (only if spherical coordinate system is used).</p>
</div></blockquote>
<p><strong>nproc</strong> : int</p>
<blockquote>
<div><p>Number of parallel processes to be used for interpolation.</p>
</div></blockquote>
<p><strong>contours</strong> : bool</p>
<blockquote>
<div><p>If True contour lines are plotted, if False a colorscale plot will be created</p>
</div></blockquote>
<p><strong>clev</strong> : ndarray</p>
<blockquote>
<div><p>A numpy ndarray containing the levels to be displayed with contour lines. If clev is set
then clmin, clmax and ncl are omitted</p>
</div></blockquote>
<p><strong>clmin</strong> : float</p>
<blockquote>
<div><p>Min. contour level (for setting auto-contours between clmin and clmax at ncl values)</p>
</div></blockquote>
<p><strong>clmax</strong> : float</p>
<blockquote>
<div><p>Max. contour level (for setting auto-contours between clmin and clmax at ncl values)</p>
</div></blockquote>
<p><strong>ncl</strong> : float</p>
<blockquote>
<div><p>Number of contour levels (for setting auto-contours between clmin and clmax at ncl values)</p>
</div></blockquote>
<p><strong>cllog</strong> : bool</p>
<blockquote>
<div><p>If clmin, clmax and ncl are used to generate the contour levels, then if cllog is True
the contours will be log-scaled</p>
</div></blockquote>
<p><strong>clcol</strong> : str</p>
<blockquote>
<div><p>Color-code for the contour lines for single color contours</p>
</div></blockquote>
<p><strong>cllabel</strong> : bool</p>
<blockquote>
<div><p>If True the contour line values will be displayed, if False only the contour lines will be
displayed (default = False)</p>
</div></blockquote>
<p><strong>cllabel_fontsize: int</strong></p>
<blockquote>
<div><p>Size of the font used to displaye the contour line values</p>
</div></blockquote>
<p><strong>cllabel_fmt</strong> : str</p>
<blockquote>
<div><p>Format of the contour line labels (default &#8220;%.1f&#8221;)</p>
</div></blockquote>
<p><strong>clalpha</strong> : float</p>
<blockquote>
<div><p>Transparency of the contour lines (1.0 fully opaque, 0.0 fully transparent)</p>
</div></blockquote>
<p><strong>lattitude</strong> : bool</p>
<blockquote>
<div><p>If the coordinate sytem used in RADMC-3D is spherical, then the 2nd coordiante is the 
co-lattitude. If lattitude is set to True then the 2nd coordinate in the RADMC-3D grid will be 
transformet to true lattitude (i.e. pi/2.-colattitude). If set to false the original co-lattitude
will be used.</p>
</div></blockquote>
<p><strong>ax</strong> : matplotlib.axes.Axes</p>
<blockquote>
<div><p>Matplotlib axis to plot to</p>
</div></blockquote>
<p><strong>Keyword Arguments :</strong></p>
<blockquote class="last">
<div><p>All other keyword arugments will be passed to pcolormesh() or countour()</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.plotSpectrum">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">plotSpectrum</code><span class="sig-paren">(</span><em>a</em>, <em>ev=False</em>, <em>kev=False</em>, <em>micron=False</em>, <em>jy=False</em>, <em>lsun=False</em>, <em>lnu=False</em>, <em>nulnu=False</em>, <em>fnu=False</em>, <em>nufnu=False</em>, <em>dpc=1.0</em>, <em>oplot=False</em>, <em>xlg=False</em>, <em>ylg=False</em>, <em>obs=False</em>, <em>mol=None</em>, <em>ilin=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.plotSpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot the spectrum / SED</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>a</strong> : ndarray</p>
<blockquote>
<div><p>A 2D array of size [Nfreq,2] returned by readSpectrum(). 
[:,0] - wavelength in micrometer, or for line data the velocity in km/s
[:,1] - flux density in erg/s/cm/cm/Hz</p>
</div></blockquote>
<p><strong>ev</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; energy in electronvolt (default=Hz)</p>
</div></blockquote>
<p><strong>kev</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; energy in kiloelectronvolt (default=Hz)</p>
</div></blockquote>
<p><strong>micron</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; wavelength in micron (default=Hz)</p>
</div></blockquote>
<p><strong>jy</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; Flux in Jansky</p>
</div></blockquote>
<p><strong>lnu</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; L_nu (default L_nu)</p>
</div></blockquote>
<p><strong>fnu</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; F_nu in units of erg/s/cm^2/Hz(default L_nu)</p>
</div></blockquote>
<p><strong>nufnu</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; nu*F_nu in units of erg/s/cm^2 (default L_nu)</p>
</div></blockquote>
<p><strong>nulnu</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; nu*L_nu (default F_nu)</p>
</div></blockquote>
<p><strong>lsun</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; nu*L_nu in units of solar luminosity</p>
</div></blockquote>
<p><strong>dpc</strong> : bool</p>
<blockquote>
<div><p>Distance of observer in units of parsec (Default: 1 pc)</p>
</div></blockquote>
<p><strong>oplot</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; Plot without refreshing subplot</p>
</div></blockquote>
<p><strong>xlg</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; logarithmic x-axis</p>
</div></blockquote>
<p><strong>ylg</strong> : bool</p>
<blockquote>
<div><p>True &#8211;&gt; logarithmic y-axis</p>
</div></blockquote>
<p><strong>obs</strong> : bool</p>
<blockquote>
<div><dl class="docutils">
<dt>True &#8211;&gt; Treat the spectrum as an observation</dt>
<dd><p class="first last">(i.e. do not scale with dpc^(-2))</p>
</dd>
</dl>
</div></blockquote>
<p><strong>mol</strong> : radmc3dMolecule</p>
<blockquote>
<div><dl class="docutils">
<dt>(optional) Molecule data (see radmc3dMolecule class)</dt>
<dd><p class="first last">This is required if you want to plot a line spectrum
with on the x-axis the radial velocity in km/s</p>
</dd>
</dl>
</div></blockquote>
<p><strong>ilin</strong> : bool</p>
<blockquote class="last">
<div><dl class="docutils">
<dt>(if set) the index of the line (of mol; starting,</dt>
<dd><p class="first last">as in RADMC-3D, with the index 1) which shall act
as the 0 km/s wavelength reference. If ilin is set
the x axis will be in km/s (overriding other settings)</p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readData">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readData</code><span class="sig-paren">(</span><em>ddens=False</em>, <em>dtemp=False</em>, <em>gdens=False</em>, <em>gtemp=False</em>, <em>gvel=False</em>, <em>ispec=None</em>, <em>vturb=False</em>, <em>grid=None</em>, <em>binary=True</em>, <em>old=False</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readData" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the physical variables of the model (e.g. density, velocity, temperature).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ddens</strong> : bool</p>
<blockquote>
<div><p>If True dust density will be read (all dust species and grain sizes)</p>
</div></blockquote>
<p><strong>dtemp</strong> : bool</p>
<blockquote>
<div><p>If True dust temperature will be read (all dust species and grain sizes)</p>
</div></blockquote>
<p><strong>gdens</strong> : bool</p>
<blockquote>
<div><p>If True gas density will be read (NOTE: the gas density will be number density in 1/cm^3)</p>
</div></blockquote>
<p><strong>gtemp</strong> : bool</p>
<blockquote>
<div><p>If True gas temperature will be read (all dust species and grain sizes)</p>
</div></blockquote>
<p><strong>gvel</strong> : bool</p>
<blockquote>
<div><p>If True the velocity field will be read</p>
</div></blockquote>
<p><strong>ispec</strong> : str</p>
<blockquote>
<div><p>Name of the molecule in the &#8216;molecule_ispec.inp&#8217; filename</p>
</div></blockquote>
<p><strong>vturb</strong> : bool</p>
<blockquote>
<div><p>If True the microturbulent velocity field will be read</p>
</div></blockquote>
<p><strong>grid</strong> : radmc3dGrid</p>
<blockquote>
<div><p>An instance of radmc3dGrid containing the spatial and frequency grid of the model. If the grid
is passed to the function it will not be read again from file. This can be useful for octree
models to save time.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
<p><strong>binary: bool</strong></p>
<blockquote>
<div><p>Set it to True for C-style binary and False for formatted ASCII files</p>
</div></blockquote>
<p><strong>octree: bool</strong></p>
<blockquote>
<div><p>True for models with octree AMR and False for models with regular grid</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns an instance of the radmc3dData class</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readGrid">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readGrid</code><span class="sig-paren">(</span><em>sgrid=True</em>, <em>wgrid=True</em>, <em>sgrid_fname=None</em>, <em>wgrid_fname=None</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the spatial and frequency grid.
This function is an interface to radmc3dGrid.readGrid().</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>sgrid</strong> : bool</p>
<blockquote>
<div><p>If True the spatial grid will be read</p>
</div></blockquote>
<p><strong>wgrid</strong> : bool</p>
<blockquote>
<div><p>If True the wavelength grid will be read</p>
</div></blockquote>
<p><strong>sgrid_fname</strong> : str</p>
<blockquote>
<div><p>File containing the spatial grid (default: amr_grid.inp)</p>
</div></blockquote>
<p><strong>wgrid_fname</strong> : str</p>
<blockquote>
<div><p>File containing the wavelength grid (default: wavelength_micron.inp)</p>
</div></blockquote>
<p><strong>old</strong> : bool</p>
<blockquote>
<div><p>If True the format of the old 2D version of radmc3d (radmc) will be used</p>
</div></blockquote>
<p><strong>Returns</strong></p>
<p><strong>&#8212;&#8212;-</strong></p>
<p class="last"><strong>Returns an instance of the radmc3dGrid (for regular grid) or radmc3dOctree (for octree AMR) class</strong></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readMol">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readMol</code><span class="sig-paren">(</span><em>mol=None</em>, <em>fname=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readMol" title="Permalink to this definition">¶</a></dt>
<dd><p>Wrapper around the radmc3dMolecule.read() method</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>mol</strong> : str</p>
<blockquote>
<div><p>molecule name (e.g. &#8216;co&#8217;) if the file name is in the form of &#8216;molecule_&lt;mol&gt;.inp&#8217;</p>
</div></blockquote>
<p><strong>fname</strong> : str</p>
<blockquote class="last">
<div><p>full file name</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readOpac">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readOpac</code><span class="sig-paren">(</span><em>ext=None</em>, <em>idust=None</em>, <em>scatmat=None</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the dust opacity files.
This function is an interface to radmc3dDustOpac.readOpac()</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ext</strong> : list</p>
<blockquote>
<div><p>Each element of the list is be a string, the file name extension
(file names should look like &#8216;dustkappa_ext.inp&#8217;)</p>
</div></blockquote>
<p><strong>idust</strong> : list</p>
<blockquote>
<div><p>Each element of the list is an integer, the index of the dust species in the master opacity file
(dustopac.inp&#8217;)</p>
</div></blockquote>
<p><strong>scatmat: list</strong></p>
<blockquote>
<div><p>If specified, its elements should be booleans indicating whether the opacity file
contains also the full scattering matrix (True) or only dust opacities (False)</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns an instance of the radmc3dDustOpac class</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readParams">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readParams</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readParams" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the problem_params.inp file.
This function is an interface to radmc3dPar.readPar().</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Returns an instance of the radmc3dPar class</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readSpectrum">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readSpectrum</code><span class="sig-paren">(</span><em>fname=''</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readSpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the spectrum / SED</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file to be read</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns an ndarray with [Nwavelength, 2] dimensions</p>
<blockquote class="last">
<div><p>[Nwavelength,0] is the wavelength / velocity and
[Nwavelength,1] is the flux density</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.readStars">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">readStars</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.readStars" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the data (mass, radius, temperature, spectrum) of discrete stellar sources</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>Name of the file to be read (if omitted the default value is stars.inp)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An instance of radmc3dRadSources containing the stellar data</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.analyze.writeDefaultParfile">
<code class="descclassname">radmc3dPy.analyze.</code><code class="descname">writeDefaultParfile</code><span class="sig-paren">(</span><em>model=''</em>, <em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.analyze.writeDefaultParfile" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes a parameter file (problem_params.inp) with default parameters for a given model.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote>
<div><p>Name of the model whose parameter should be written to the file</p>
</div></blockquote>
<p><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>Name of the parameter file to be written (if omitted problem_params.inp will be used)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.conf">
<span id="radmc3dpy-conf-module"></span><h2>radmc3dPy.conf module<a class="headerlink" href="#module-radmc3dPy.conf" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-radmc3dPy.crd_trans">
<span id="radmc3dpy-crd-trans-module"></span><h2>radmc3dPy.crd_trans module<a class="headerlink" href="#module-radmc3dPy.crd_trans" title="Permalink to this headline">¶</a></h2>
<p>This module contains functions for coordinate transformations (e.g. rotation).
For help on the syntax or functionality of each function see the help of the individual functions</p>
<dl class="function">
<dt id="radmc3dPy.crd_trans.csrot">
<code class="descclassname">radmc3dPy.crd_trans.</code><code class="descname">csrot</code><span class="sig-paren">(</span><em>crd=None</em>, <em>ang=None</em>, <em>xang=0.0</em>, <em>yang=0.0</em>, <em>zang=0.0</em>, <em>deg=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.crd_trans.csrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs coordinate system rotation.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd</strong> : numpy ndarray</p>
<blockquote>
<div><p>Three element vector containing the coordinates of a given point in a cartesian system</p>
</div></blockquote>
<p><strong>ang</strong> : list, ndarray</p>
<blockquote>
<div><p>Three element list/ndarray describing the rotation angles around the x, y and z axes, respectively</p>
</div></blockquote>
<p><strong>xang: float</strong></p>
<blockquote>
<div><p>Rotation around the x-axis</p>
</div></blockquote>
<p><strong>yang: float</strong></p>
<blockquote>
<div><p>Rotation around the y-axis</p>
</div></blockquote>
<p><strong>zang: float</strong></p>
<blockquote>
<div><p>Rotation around the z-axis</p>
</div></blockquote>
<p><strong>deg</strong> : float, optional</p>
<blockquote>
<div><p>If True angles should be given in degree instead of radians (as by default)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list</p>
<blockquote class="last">
<div><p>Returns a three element list with the rotated coordinates</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Rotation matrices</p>
<p>Around the x-axis:</p>
<div class="math">
\[\begin{split}\left(\begin{matrix} 
        1 &amp; 0 &amp; 0 \\
        0 &amp; cos(\alpha) &amp; -sin(\alpha)\\
        0 &amp; sin(\alpha) &amp; cos(\alpha)
        \end{matrix}\right)\end{split}\]</div>
<p>Around the y-axis:</p>
<div class="math">
\[\begin{split}\left(\begin{matrix} 
        cos(\beta) &amp; 0 &amp; -sin(\beta) \\
        0 &amp; 1 &amp; 0\\
        sin(\beta)&amp; 0 &amp; cos(\beta)
        \end{matrix}\right)\end{split}\]</div>
<p>Around the z-axis</p>
<div class="math">
\[\begin{split}\left(\begin{matrix} 
        cos(\gamma) &amp; -sin\gamma) &amp; 0 \\
        sin(\gamma) &amp;  cos(\gamma) &amp; 0 \\
        0  &amp; 0 &amp; 1
        \end{matrix}\right)\end{split}\]</div>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.crd_trans.ctransSph2Cart">
<code class="descclassname">radmc3dPy.crd_trans.</code><code class="descname">ctransSph2Cart</code><span class="sig-paren">(</span><em>crd=None</em>, <em>reverse=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.crd_trans.ctransSph2Cart" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform coordinates between spherical to cartesian systems</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd</strong> : ndarray</p>
<blockquote>
<div><p>Three element array containing the input
coordinates [x,y,z] or [r,theta,phi] by default
the coordinates assumed to be in the cartesian system</p>
</div></blockquote>
<p><strong>reverse</strong> : bool</p>
<blockquote>
<div><p>If True calculates the inverse transformation
(cartesian -&gt; spherical). In this case crd should be [r,theta,phi]</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns a three element array containig the output coordinates [r,theta,phi] or [x,y,z]</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.crd_trans.vrot">
<code class="descclassname">radmc3dPy.crd_trans.</code><code class="descname">vrot</code><span class="sig-paren">(</span><em>crd=None</em>, <em>v=None</em>, <em>ang=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.crd_trans.vrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Rotates a vector in spherical coordinate system.
First transforms the vector to cartesian coordinate system, then does the rotation then 
makes the inverse transformation</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd</strong> : ndarray</p>
<blockquote>
<div><p>Three element array containing the coordinates of a
given point in the cartesian system</p>
</div></blockquote>
<p><strong>v</strong> : ndarray</p>
<blockquote>
<div><p>Three element array, angles of rotation around the x,y,z axes</p>
</div></blockquote>
<p><strong>ang</strong> : ndarray</p>
<blockquote class="last">
<div><p>Three element arrray containing the angles to rotate around the x, y, z, axes, respectively</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.crd_trans.vtransSph2Cart">
<code class="descclassname">radmc3dPy.crd_trans.</code><code class="descname">vtransSph2Cart</code><span class="sig-paren">(</span><em>crd=None</em>, <em>v=None</em>, <em>reverse=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.crd_trans.vtransSph2Cart" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform velocities between spherical to cartesian systems</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd</strong> : ndarray</p>
<blockquote>
<div><p>Three element array containing the input
coordinates [x,y,z] or [r,theta,phi] by default
the coordinates assumed to be in the cartesian system</p>
</div></blockquote>
<p><strong>v</strong> : ndarray</p>
<blockquote>
<div><p>Three element array containing the input
velocities in the same coordinate system as crd</p>
</div></blockquote>
<p><strong>reverse</strong> : bool</p>
<blockquote>
<div><p>If True it calculates the inverse trasnformation (cartesian -&gt; spherical)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns a three element array containg the output velocities [vr,vphi,vtheta] or [vx,vy,vz]</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.data">
<span id="radmc3dpy-data-module"></span><h2>radmc3dPy.data module<a class="headerlink" href="#module-radmc3dPy.data" title="Permalink to this headline">¶</a></h2>
<p>This module contains a class for handling variable data in radmc-3d</p>
<dl class="class">
<dt id="radmc3dPy.data.radmc3dData">
<em class="property">class </em><code class="descclassname">radmc3dPy.data.</code><code class="descname">radmc3dData</code><span class="sig-paren">(</span><em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<dl class="docutils">
<dt>RADMC-3D data class.</dt>
<dd>Reading and writing dust density/temperature, gas density/temperature/velocity,
generating a legacy vtk file for visualization.</dd>
</dl>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="8%" />
<col width="92%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>grid</td>
<td>(radmc3dGrid, radmc3dOctree) Instance of the radmc3dGrid class, contains the spatial and frequency grids</td>
</tr>
<tr class="row-even"><td>rhodust</td>
<td>(ndarray) Dust density in g/cm^3</td>
</tr>
<tr class="row-odd"><td>dusttemp</td>
<td>(ndarray) Dust temperature in K</td>
</tr>
<tr class="row-even"><td>rhogas</td>
<td>(ndarray) Gas density in g/cm^3</td>
</tr>
<tr class="row-odd"><td>ndens_mol</td>
<td>(ndarray) Number density of the molecule [molecule/cm^3]</td>
</tr>
<tr class="row-even"><td>ndens_cp</td>
<td>(ndarray) Number density of the collisional partner [molecule/cm^3]</td>
</tr>
<tr class="row-odd"><td>gasvel</td>
<td>(ndarray) Gas velocity in cm/s</td>
</tr>
<tr class="row-even"><td>gastemp</td>
<td>(ndarray) Gas temperature in K</td>
</tr>
<tr class="row-odd"><td>vturb</td>
<td>(ndarray) Mictroturbulence in cm/s</td>
</tr>
<tr class="row-even"><td>taux</td>
<td>(ndarray) Optical depth along the x (cartesian) / r (cylindrical) / r (spherical) dimension</td>
</tr>
<tr class="row-odd"><td>tauy</td>
<td>(ndarray) Optical depth along the y (cartesian) / theta (cylindrical) / theta (spherical) dimension</td>
</tr>
<tr class="row-even"><td>tauz</td>
<td>(ndarray) Optical depth along the z (cartesian) / z (cylindrical) / phi (spherical) dimension</td>
</tr>
<tr class="row-odd"><td>sigmadust</td>
<td>(ndarray) Dust surface density in g/cm^2</td>
</tr>
<tr class="row-even"><td>sigmagas</td>
<td>(ndarray) Gas surface density in molecule/cm^2 (or g/cm^2 depending on the dimension of rhogas)</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.getDustMass" title="radmc3dPy.data.radmc3dData.getDustMass"><code class="xref py py-obj docutils literal"><span class="pre">getDustMass</span></code></a>([idust])</td>
<td>Calculates the dust mass in radmc3dData.rhodust</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.getGasMass" title="radmc3dPy.data.radmc3dData.getGasMass"><code class="xref py py-obj docutils literal"><span class="pre">getGasMass</span></code></a>([mweight,&nbsp;rhogas])</td>
<td>Calculates the gas mass in radmc3dData.ndens_mol or radmc3dData.rhogas</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.getSigmaDust" title="radmc3dPy.data.radmc3dData.getSigmaDust"><code class="xref py py-obj docutils literal"><span class="pre">getSigmaDust</span></code></a>([idust])</td>
<td>Calculates the dust surface density.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.getSigmaGas" title="radmc3dPy.data.radmc3dData.getSigmaGas"><code class="xref py py-obj docutils literal"><span class="pre">getSigmaGas</span></code></a>()</td>
<td>Calculates the gas surface density.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.getTau" title="radmc3dPy.data.radmc3dData.getTau"><code class="xref py py-obj docutils literal"><span class="pre">getTau</span></code></a>([idust,&nbsp;axis,&nbsp;wav,&nbsp;kappa,&nbsp;old])</td>
<td>Calculates the optical depth along any given combination of the axes.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.getTauOneDust" title="radmc3dPy.data.radmc3dData.getTauOneDust"><code class="xref py py-obj docutils literal"><span class="pre">getTauOneDust</span></code></a>([idust,&nbsp;axis,&nbsp;kappa])</td>
<td>Calculates the optical depth of a single dust species along any given combination of the axes.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.readDustDens" title="radmc3dPy.data.radmc3dData.readDustDens"><code class="xref py py-obj docutils literal"><span class="pre">readDustDens</span></code></a>([fname,&nbsp;binary,&nbsp;old,&nbsp;octree])</td>
<td>Reads the dust density.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.readDustTemp" title="radmc3dPy.data.radmc3dData.readDustTemp"><code class="xref py py-obj docutils literal"><span class="pre">readDustTemp</span></code></a>([fname,&nbsp;binary,&nbsp;octree,&nbsp;old])</td>
<td>Reads the dust temperature.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.readGasDens" title="radmc3dPy.data.radmc3dData.readGasDens"><code class="xref py py-obj docutils literal"><span class="pre">readGasDens</span></code></a>([fname,&nbsp;ispec,&nbsp;binary,&nbsp;octree])</td>
<td>Reads the gas density.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.readGasTemp" title="radmc3dPy.data.radmc3dData.readGasTemp"><code class="xref py py-obj docutils literal"><span class="pre">readGasTemp</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Reads the gas temperature.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.readGasVel" title="radmc3dPy.data.radmc3dData.readGasVel"><code class="xref py py-obj docutils literal"><span class="pre">readGasVel</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Reads the gas velocity.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.readVTurb" title="radmc3dPy.data.radmc3dData.readVTurb"><code class="xref py py-obj docutils literal"><span class="pre">readVTurb</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Reads the turbulent velocity field.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeDustDens" title="radmc3dPy.data.radmc3dData.writeDustDens"><code class="xref py py-obj docutils literal"><span class="pre">writeDustDens</span></code></a>([fname,&nbsp;binary,&nbsp;old,&nbsp;octree])</td>
<td>Writes the dust density.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeDustTemp" title="radmc3dPy.data.radmc3dData.writeDustTemp"><code class="xref py py-obj docutils literal"><span class="pre">writeDustTemp</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Writes the dust density.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeGasDens" title="radmc3dPy.data.radmc3dData.writeGasDens"><code class="xref py py-obj docutils literal"><span class="pre">writeGasDens</span></code></a>([fname,&nbsp;ispec,&nbsp;binary,&nbsp;octree])</td>
<td>Writes the gas density.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeGasTemp" title="radmc3dPy.data.radmc3dData.writeGasTemp"><code class="xref py py-obj docutils literal"><span class="pre">writeGasTemp</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Writes the gas temperature.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeGasVel" title="radmc3dPy.data.radmc3dData.writeGasVel"><code class="xref py py-obj docutils literal"><span class="pre">writeGasVel</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Writes the gas velocity.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeVTK" title="radmc3dPy.data.radmc3dData.writeVTK"><code class="xref py py-obj docutils literal"><span class="pre">writeVTK</span></code></a>([vtk_fname,&nbsp;ddens,&nbsp;dtemp,&nbsp;idust,&nbsp;...])</td>
<td>Writes physical variables to a legacy vtk file.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.data.radmc3dData.writeVTurb" title="radmc3dPy.data.radmc3dData.writeVTurb"><code class="xref py py-obj docutils literal"><span class="pre">writeVTurb</span></code></a>([fname,&nbsp;binary,&nbsp;octree])</td>
<td>Writes the microturbulence file.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.getDustMass">
<code class="descname">getDustMass</code><span class="sig-paren">(</span><em>idust=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.getDustMass" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the dust mass in radmc3dData.rhodust</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>idust</strong> : int</p>
<blockquote>
<div><p>Dust index whose dust should be calculated. If it is set to -1 (default) the total
dust mass is calculated summing up all dust species</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A single float being the dust mass in gramm</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.getGasMass">
<code class="descname">getGasMass</code><span class="sig-paren">(</span><em>mweight=2.3</em>, <em>rhogas=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.getGasMass" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the gas mass in radmc3dData.ndens_mol or radmc3dData.rhogas</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>mweight</strong> : float</p>
<blockquote>
<div><blockquote>
<div><p>Molecular weight [atomic mass unit / molecule, i.e. same unit as mean molecular weight]</p>
</div></blockquote>
<dl class="docutils">
<dt>rhogas <span class="classifier-delimiter">:</span> <span class="classifier">bool, optional</span></dt>
<dd><p class="first last">If True the gas mass will be calculated from radmc3dData.rhogas, while if set to False
the gas mass will be calculated from radmc3dData.ndens_mol. The mweight parameter is only
required for the latter.</p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A single float being the gas mass in gramm</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.getSigmaDust">
<code class="descname">getSigmaDust</code><span class="sig-paren">(</span><em>idust=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.getSigmaDust" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the dust surface density.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>idust</strong> : int, optional</p>
<blockquote class="last">
<div><p>Index of the dust species for which the surface density should be calculated
if omitted the calculated surface density will be the sum over all dust species</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.getSigmaGas">
<code class="descname">getSigmaGas</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.getSigmaGas" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the gas surface density.
This method uses radmc3dData.rhogas to calculate the surface density, thus the
unit of surface density depends on the unit of radmc3dData.rhogas (g/cm^2 or molecule/cm^2)</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.getTau">
<code class="descname">getTau</code><span class="sig-paren">(</span><em>idust=None</em>, <em>axis='xy'</em>, <em>wav=0.0</em>, <em>kappa=None</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.getTau" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the optical depth along any given combination of the axes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>idust</strong> : list</p>
<blockquote>
<div><p>List of dust component indices whose optical depth should be calculated
If multiple indices are set the total optical depth is calculated summing
over all dust species in idust</p>
</div></blockquote>
<p><strong>axis</strong> : str</p>
<blockquote>
<div><p>Name of the axis/axes along which the optical depth should be calculated
(e.g. &#8216;x&#8217; for the first dimension or &#8216;xyz&#8217; for all three dimensions)</p>
</div></blockquote>
<p><strong>wav</strong> : float</p>
<blockquote>
<div><p>Wavelength at which the optical depth should be calculated</p>
</div></blockquote>
<p><strong>kappa</strong> : list, tuple</p>
<blockquote>
<div><p>If set it should be a list of mass extinction coefficients at the desired wavelength
The number of elements in the list should be equal to that in the idust keyword</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.getTauOneDust">
<code class="descname">getTauOneDust</code><span class="sig-paren">(</span><em>idust=0</em>, <em>axis=''</em>, <em>kappa=0.0</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.getTauOneDust" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the optical depth of a single dust species along any given combination of the axes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>idust</strong> : int</p>
<blockquote>
<div><p>Index of the dust species whose optical depth should be calculated</p>
</div></blockquote>
<p><strong>axis</strong> : str</p>
<blockquote>
<div><p>Name of the axis/axes along which the optical depth should be calculated
(e.g. &#8216;x&#8217; for the first dimension or &#8216;xyz&#8217; for all three dimensions)</p>
</div></blockquote>
<p><strong>kappa</strong> : float</p>
<blockquote>
<div><p>Mass extinction coefficients of the dust species at the desired wavelength</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys</p>
<blockquote class="last">
<div><dl class="docutils">
<dt>taux <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">optical depth along the first dimension</p>
</dd>
<dt>tauy <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">optical depth along the second dimension</p>
</dd>
</dl>
<p>(tauz is not yet implemented)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.readDustDens">
<code class="descname">readDustDens</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=True</em>, <em>old=False</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.readDustDens" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the dust density.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file that contains the dust density. If omitted &#8216;dust_density.inp&#8217; is used
(or if binary=True the &#8216;dust_density.binp&#8217; is used).</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote>
<div><p>If true the data will be read in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.readDustTemp">
<code class="descname">readDustTemp</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=True</em>, <em>octree=False</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.readDustTemp" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the dust temperature.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file that contains the dust temperature.</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote>
<div><p>If true the data will be read in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote>
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If True dust temperature will be written in the old RADMC format</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.readGasDens">
<code class="descname">readGasDens</code><span class="sig-paren">(</span><em>fname=None</em>, <em>ispec=''</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.readGasDens" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the gas density.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ispec</strong> : str</p>
<blockquote>
<div><p>File name extension of the &#8216;numberdens_ispec.inp&#8217; (or if binary=True &#8216;numberdens_ispec.binp&#8217;) file.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be read in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.readGasTemp">
<code class="descname">readGasTemp</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.readGasTemp" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the gas temperature.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str,optional</p>
<blockquote>
<div><p>Name of the file that contains the gas temperature. If omitted &#8216;gas_temperature.inp&#8217;
(or if binary=True &#8216;gas_tempearture.binp&#8217;) is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be read in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.readGasVel">
<code class="descname">readGasVel</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.readGasVel" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the gas velocity.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file that contains the gas velocity
If omitted &#8216;gas_velocity.inp&#8217; (if binary=True &#8216;gas_velocity.binp&#8217;)is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be read in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.readVTurb">
<code class="descname">readVTurb</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.readVTurb" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the turbulent velocity field.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file that contains the turbulent velocity field
If omitted &#8216;microturbulence.inp&#8217; (if binary=True &#8216;microturbulence.binp&#8217;) is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be read in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeDustDens">
<code class="descname">writeDustDens</code><span class="sig-paren">(</span><em>fname=''</em>, <em>binary=True</em>, <em>old=False</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeDustDens" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the dust density.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the dust density should be written. If omitted &#8216;dust_density.inp&#8217; is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be written in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeDustTemp">
<code class="descname">writeDustTemp</code><span class="sig-paren">(</span><em>fname=''</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeDustTemp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the dust density.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the dust density should be written. If omitted &#8216;dust_density.inp&#8217; is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be written in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeGasDens">
<code class="descname">writeGasDens</code><span class="sig-paren">(</span><em>fname=None</em>, <em>ispec=''</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeGasDens" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the gas density.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the data will be written. If omitted &#8220;numberdens_xxx.inp&#8221; and
&#8220;numberdens_xxx.binp&#8221; will be used for ascii and binary format, respectively
(xxx is the name of the molecule).</p>
</div></blockquote>
<p><strong>ispec</strong> : str</p>
<blockquote>
<div><p>File name extension of the &#8216;numberdens_ispec.inp&#8217; (if binary=True &#8216;numberdens_ispec.binp&#8217;)
file into which the gas density should be written</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be written in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeGasTemp">
<code class="descname">writeGasTemp</code><span class="sig-paren">(</span><em>fname=''</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeGasTemp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the gas temperature.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the gas temperature should be written. If omitted
&#8216;gas_temperature.inp&#8217; (if binary=True &#8216;gas_tempearture.binp&#8217;) is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be written in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeGasVel">
<code class="descname">writeGasVel</code><span class="sig-paren">(</span><em>fname=''</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeGasVel" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the gas velocity.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the gas temperature should be written.
If omitted &#8216;gas_velocity.inp&#8217; (if binary=True &#8216;gas_velocity.binp&#8217;) is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be written in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeVTK">
<code class="descname">writeVTK</code><span class="sig-paren">(</span><em>vtk_fname=''</em>, <em>ddens=False</em>, <em>dtemp=False</em>, <em>idust=None</em>, <em>gdens=False</em>, <em>gvel=False</em>, <em>gtemp=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeVTK" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes physical variables to a legacy vtk file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>vtk_fname</strong> : str</p>
<blockquote>
<div><p>Name of the file to be written, if not specified &#8216;radmc3d_data.vtk&#8217; will be used</p>
</div></blockquote>
<p><strong>ddens</strong> : bool</p>
<blockquote>
<div><p>If set to True the dust density will be written to the vtk file</p>
</div></blockquote>
<p><strong>dtemp</strong> : bool</p>
<blockquote>
<div><p>If set to True the dust temperature will be written to the vtk file</p>
</div></blockquote>
<p><strong>idust</strong> : list</p>
<blockquote>
<div><p>List of indices that specifies which dust component should be written
if not set then the first dust species (zero index) will be used</p>
</div></blockquote>
<p><strong>gdens</strong> : bool</p>
<blockquote>
<div><p>If set to True the gas density will be written to the vtk file</p>
</div></blockquote>
<p><strong>gtemp</strong> : bool</p>
<blockquote>
<div><p>If set to True the gas temperature will be written to the vtk file</p>
</div></blockquote>
<p><strong>gvel</strong> : bool</p>
<blockquote class="last">
<div><p>If set to True the gas velocity will be written to the vtk file</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.data.radmc3dData.writeVTurb">
<code class="descname">writeVTurb</code><span class="sig-paren">(</span><em>fname=''</em>, <em>binary=True</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.data.radmc3dData.writeVTurb" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the microturbulence file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the turubulent velocity field should be written.
If omitted &#8216;microturbulence.inp&#8217; (if binary=True &#8216;microturbuulence.binp&#8217;) is used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool</p>
<blockquote>
<div><p>If true the data will be written in binary format, otherwise the file format is ascii</p>
</div></blockquote>
<p><strong>octree</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If the data is defined on an octree-like AMR</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.dustopac">
<span id="radmc3dpy-dustopac-module"></span><h2>radmc3dPy.dustopac module<a class="headerlink" href="#module-radmc3dPy.dustopac" title="Permalink to this headline">¶</a></h2>
<p>This module contains classes for handling dust opacities</p>
<dl class="function">
<dt id="radmc3dPy.dustopac.computeDustOpacMie">
<code class="descclassname">radmc3dPy.dustopac.</code><code class="descname">computeDustOpacMie</code><span class="sig-paren">(</span><em>fname=''</em>, <em>matdens=None</em>, <em>agraincm=None</em>, <em>lamcm=None</em>, <em>theta=None</em>, <em>logawidth=None</em>, <em>wfact=3.0</em>, <em>na=20</em>, <em>chopforward=0.0</em>, <em>errtol=0.01</em>, <em>verbose=False</em>, <em>extrapolate=False</em>, <em>return_type=1</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.computeDustOpacMie" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute dust opacity with Mie theory based on the optical constants
in the optconst_file. Optionally also the scattering phase function
in terms of the Mueller matrix elements can be computed. To smear out
the resonances that appear due to the perfect sphere shape, you can
optionally smear out the grain size distribution a bit with setting
the width of a Gaussian grain size distribution.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>File name of the optical constants file. This file
should contain three columns: first the wavelength
in micron, then the n-coefficient and then the
k-coefficient. See Jena optical constants database:
<a class="reference external" href="http://www.astro.uni-jena.de/Laboratory/Database/databases.html">http://www.astro.uni-jena.de/Laboratory/Database/databases.html</a></p>
</div></blockquote>
<p><strong>matdens</strong> : float</p>
<blockquote>
<div><p>Material density in g/cm^3</p>
</div></blockquote>
<p><strong>agraincm</strong> : float</p>
<blockquote>
<div><p>Grain radius in cm</p>
</div></blockquote>
<p><strong>lamcm</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid in cm</p>
</div></blockquote>
<p><strong>theta</strong> : ndarray, optional</p>
<blockquote>
<div><p>Angular grid (a numpy array) between 0 and 180
which are the scattering angle sampling points at
which the scattering phase function is computed.</p>
</div></blockquote>
<p><strong>logawidth</strong> : float, optional</p>
<blockquote>
<div><p>If set, the size agrain will instead be a
sample of sizes around agrain. This helps to smooth out
the strong wiggles in the phase function and opacity
of spheres at an exact size. Since in Nature it rarely
happens that grains all have exactly the same size, this
is quite natural. The value of logawidth sets the width
of the Gauss in ln(agrain), so for logawidth&lt;&lt;1 this
give a real width of logawidth*agraincm.</p>
</div></blockquote>
<p><strong>wfact</strong> : float</p>
<blockquote>
<div><p>Grid width of na sampling points in units
of logawidth. The Gauss distribution of grain sizes is
cut off at agrain * exp(wfact*logawidth) and
agrain * exp(-wfact*logawidth). Default = 3</p>
</div></blockquote>
<p><strong>na</strong> : int</p>
<blockquote>
<div><p>Number of size sampling points (if logawidth set, default=20)</p>
</div></blockquote>
<p><strong>chopforward</strong> : float</p>
<blockquote>
<div><p>If &gt;0 this gives the angle (in degrees from forward)
within which the scattering phase function should be
kept constant, essentially removing the strongly peaked
forward scattering. This is useful for large grains
(large ratio 2*pi*agraincm/lamcm) where the forward
scattering peak is extremely strong, yet extremely
narrow. If we are not interested in very forward-peaked
scattering (e.g. only relevant when modeling e.g. the
halo around the moon on a cold winter night), this will
remove this component and allow a lower angular grid
resolution for the theta grid.</p>
</div></blockquote>
<p><strong>errtol</strong> : float</p>
<blockquote>
<div><p>Tolerance of the relative difference between kscat
and the integral over the zscat Z11 element over angle.
If this tolerance is exceeded, a warning is given.</p>
</div></blockquote>
<p><strong>verbose</strong> : bool</p>
<blockquote>
<div><p>If set to True, the code will give some feedback so
that one knows what it is doing if it becomes slow.</p>
</div></blockquote>
<p><strong>extrapolate</strong> : bool</p>
<blockquote>
<div><p>If set to True, then if the wavelength grid lamcm goes
out of the range of the wavelength grid of the
optical constants file, then it will make a suitable
extrapolation: keeping the optical constants constant
for lamcm &lt; minimum, and extrapolating log-log for
lamcm &gt; maximum.</p>
</div></blockquote>
<p><strong>return_type</strong> : {0, 1}</p>
<blockquote>
<div><p>If 0 a dictionary is returned (original return type)
if 1 an instance of radmc3dDustOpac will be returned</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary with the following keys:</p>
<blockquote class="last">
<div><ul>
<li><dl class="first docutils">
<dt>kabs <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">Absorption opacity kappa_abs_nu (a numpy array) in
units of cm^2/gram</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>ksca <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">Scattering opacity kappa_abs_nu (a numpy array) in
units of cm^2/gram</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>gsca <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">The &lt;cos(theta)&gt; g-factor of scattering</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>theta <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if theta is given at input)</span></dt>
<dd><p class="first last">The theta grid itself (just a copy of what was given)</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>zscat <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if theta is given at input)</span></dt>
<dd><p class="first">The components of the scattering Mueller matrix
Z_ij for each wavelength and each scattering angel.
The normalization of Z is such that kscat can be
reproduced (as can be checked) by the integral:
2*pi*int_{-1}^{+1}Z11(mu)dmu=kappa_scat.
For symmetry reasons only 6 elements of the Z
matrix are returned: Z11, Z12, Z22, Z33, Z34, Z44.
Note that Z21 = Z12 and Z43 = -Z34.
The scattering matrix is normalized such that
if a plane wave with Stokes flux</p>
<blockquote>
<div><p>Fin = (Fin_I,Fin_Q,Fin_U,Fin_V)</p>
</div></blockquote>
<p>hits a dust grain (which has mass mgrain), then
the scattered flux</p>
<blockquote>
<div><p>Fout = (Fout_I,Fout_Q,Fout_U,Fout_V)</p>
</div></blockquote>
<p>at distance r from the grain at angle theta
is given by</p>
<blockquote>
<div><p>Fout(theta) = (mgrain/r^2) * Zscat . Fin</p>
</div></blockquote>
<p class="last">where . is the matrix-vector multiplication.
Note that the Stokes components must be such
that the horizontal axis in the &#8220;image&#8221; is
pointing in the scattering plane. This means
that radiation with Fin_Q &lt; 0 is scattered well,
because it is vertically polarized (along the
scattering angle axis), while radiation with
Fin_Q &gt; 0 is scatterd less well because it
is horizontally polarized (along the scattering
plane).</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>kscat_from_z11 <span class="classifier-delimiter">:</span> <span class="classifier">ndarray  (optional, only if theta is given at input)</span></dt>
<dd><p class="first last">The kscat computed from the (above mentioned)
integral of Z11 over all angles. This should be
nearly identical to kscat if the angular grid
is sufficiently fine. If there are strong
differences, this is an indication that the
angular gridding (the theta grid) is not fine
enough. But you should have then automatically
gotten a warning message as well (see errtol).</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>wavmic <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if extrapolate is set to True)</span></dt>
<dd><p class="first last">The original wavelength grid from the optical constants file,
with possibly an added extrapolated</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>ncoef <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if extrapolate is set to True)</span></dt>
<dd><p class="first last">The optical constant n at that grid</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>kcoef <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if extrapolate is set to True)</span></dt>
<dd><p class="first last">The optical constant k at that grid</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>agr <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if logawidth is not None)</span></dt>
<dd><p class="first last">Grain sizes</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>wgt <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if logawidth is not None)</span></dt>
<dd><p class="first last">The averaging weights of these grain (not the masses!)
The sum of wgt.sum() must be 1.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>zscat_nochop <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if chopforward &gt; 0)</span></dt>
<dd><p class="first last">The zscat before the forward scattering was chopped off</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>kscat_nochop <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if chopforward &gt; 0)</span></dt>
<dd><p class="first last">The kscat originally from the bhmie code</p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="class">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac">
<em class="property">class </em><code class="descclassname">radmc3dPy.dustopac.</code><code class="descname">radmc3dDustOpac</code><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class to handle dust opacities.</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="5%" />
<col width="95%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>wav</td>
<td>(list) Each element of the list contains an ndarray with the wavelength grid</td>
</tr>
<tr class="row-even"><td>freq</td>
<td>(list) Each element of the list contains an ndarray with the frequency grid</td>
</tr>
<tr class="row-odd"><td>nwav</td>
<td>(list) Each element of the list contains an integer with the number of wavelengths</td>
</tr>
<tr class="row-even"><td>kabs</td>
<td>(list) Each element of the list contains an ndarray with the absorption coefficient per unit mass</td>
</tr>
<tr class="row-odd"><td>ksca</td>
<td>(list) Each element of the list contains an ndarray with the scattering coefficient per unit mass</td>
</tr>
<tr class="row-even"><td>phase_g</td>
<td>(list) Each element of the list contains an ndarray with the hase function</td>
</tr>
<tr class="row-odd"><td>ext</td>
<td>(list) Each element of the list contains a string wht the file name extension of the duskappa_ext.Kappa file</td>
</tr>
<tr class="row-even"><td>therm</td>
<td>(list) Each element of the list contains a bool, if it is set to False the dust grains are quantum-heated (default: True)</td>
</tr>
<tr class="row-odd"><td>idust</td>
<td>(lisintt) Each element of the list contains an integer with the index of the dust species in the dust density distribution array</td>
</tr>
<tr class="row-even"><td>scatmat</td>
<td>(list) Each element is a boolean indicating whether the dust opacity table includes (True) the full scattering matrix or not (False)</td>
</tr>
<tr class="row-odd"><td>nang</td>
<td>(list) Each element is a string, containing the number of scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-even"><td>scatang</td>
<td>(list) Each element is a numpy ndarray containing the scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-odd"><td>z11</td>
<td>(list) Each element is a numpy ndarray containing the (1,1) element of the scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-even"><td>z12</td>
<td>(list) Each element is a numpy ndarray containing the (1,2) element of the scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-odd"><td>z22</td>
<td>(list) Each element is a numpy ndarray containing the (2,2) element of the scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-even"><td>z33</td>
<td>(list) Each element is a numpy ndarray containing the (3,3) element of the scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-odd"><td>z34</td>
<td>(list) Each element is a numpy ndarray containing the (3,4) element of the scattering angles in the scattering matrix if its given</td>
</tr>
<tr class="row-even"><td>z44</td>
<td>(list) Each element is a numpy ndarray containing the (4,4) element of the scattering angles in the scattering matrix if its given</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.makeOpac" title="radmc3dPy.dustopac.radmc3dDustOpac.makeOpac"><code class="xref py py-obj docutils literal"><span class="pre">makeOpac</span></code></a>([ppar,&nbsp;wav,&nbsp;old,&nbsp;code,&nbsp;theta,&nbsp;...])</td>
<td>Createst the dust opacities using a Mie code distributed with RADMC-3D.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.makeopacRadmc2D" title="radmc3dPy.dustopac.radmc3dDustOpac.makeopacRadmc2D"><code class="xref py py-obj docutils literal"><span class="pre">makeopacRadmc2D</span></code></a>([ext])</td>
<td>Creates dust opacities (dustopac_*.inp files) for the previous 2D version of radmc</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.mixOpac" title="radmc3dPy.dustopac.radmc3dDustOpac.mixOpac"><code class="xref py py-obj docutils literal"><span class="pre">mixOpac</span></code></a>([ppar,&nbsp;mixnames,&nbsp;mixspecs,&nbsp;mixabun,&nbsp;...])</td>
<td>Mixes dust opacities.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.readMasterOpac" title="radmc3dPy.dustopac.radmc3dDustOpac.readMasterOpac"><code class="xref py py-obj docutils literal"><span class="pre">readMasterOpac</span></code></a>()</td>
<td>Reads the master opacity file &#8216;dustopac.inp&#8217;.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.readOpac" title="radmc3dPy.dustopac.radmc3dDustOpac.readOpac"><code class="xref py py-obj docutils literal"><span class="pre">readOpac</span></code></a>([ext,&nbsp;idust,&nbsp;scatmat,&nbsp;old])</td>
<td>Reads the dust opacity files.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.runMakedust" title="radmc3dPy.dustopac.radmc3dDustOpac.runMakedust"><code class="xref py py-obj docutils literal"><span class="pre">runMakedust</span></code></a>([freq,&nbsp;gmin,&nbsp;gmax,&nbsp;ngs,&nbsp;...])</td>
<td>Interface function to the F77 code makedust to calculate mass absorption coefficients.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.writeMasterOpac" title="radmc3dPy.dustopac.radmc3dDustOpac.writeMasterOpac"><code class="xref py py-obj docutils literal"><span class="pre">writeMasterOpac</span></code></a>([ext,&nbsp;therm,&nbsp;...])</td>
<td>Writes the master opacity file &#8216;dustopac.inp&#8217;.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.dustopac.radmc3dDustOpac.writeOpac" title="radmc3dPy.dustopac.radmc3dDustOpac.writeOpac"><code class="xref py py-obj docutils literal"><span class="pre">writeOpac</span></code></a>([fname,&nbsp;ext,&nbsp;idust,&nbsp;scatmat])</td>
<td>Writes dust opacities to file</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.makeOpac">
<code class="descname">makeOpac</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>wav=None</em>, <em>old=False</em>, <em>code='python'</em>, <em>theta=None</em>, <em>logawidth=None</em>, <em>wfact=3.0</em>, <em>na=20</em>, <em>chopforward=0.0</em>, <em>errtol=0.01</em>, <em>verbose=False</em>, <em>extrapolate=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.makeOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Createst the dust opacities using a Mie code distributed with RADMC-3D.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Parameters of the simulations</p>
</div></blockquote>
<p><strong>wav</strong> : ndarray, optional</p>
<blockquote>
<div><p>Wavelength grid on which the mass absorption coefficients should be calculated</p>
</div></blockquote>
<p><strong>code</strong> : {&#8216;python&#8217;, &#8216;fortran&#8217;}</p>
<blockquote>
<div><p>Version of the mie scattering code BHMIE to be used. &#8216;fortran&#8217; - use the original fortran77
code of Bruce Drain (should be downloaded separately, compiled and its path added to the PATH
environment variable), &#8216;python&#8217; a python version of BHMIE by Kees Dullemond (radmc3dPy.miescat).</p>
</div></blockquote>
<p><strong>theta</strong> : ndarray, optional</p>
<blockquote>
<div><p>Angular grid (a numpy array) between 0 and 180
which are the scattering angle sampling points at
which the scattering phase function is computed.</p>
</div></blockquote>
<p><strong>logawidth</strong> : float, optional</p>
<blockquote>
<div><p>If set, the size agrain will instead be a
sample of sizes around agrain. This helps to smooth out
the strong wiggles in the phase function and opacity
of spheres at an exact size. Since in Nature it rarely
happens that grains all have exactly the same size, this
is quite natural. The value of logawidth sets the width
of the Gauss in ln(agrain), so for logawidth&lt;&lt;1 this
give a real width of logawidth*agraincm.</p>
</div></blockquote>
<p><strong>wfact</strong> : float</p>
<blockquote>
<div><p>Grid width of na sampling points in units
of logawidth. The Gauss distribution of grain sizes is
cut off at agrain * exp(wfact*logawidth) and
agrain * exp(-wfact*logawidth). Default = 3</p>
</div></blockquote>
<p><strong>na</strong> : int</p>
<blockquote>
<div><p>Number of size sampling points (if logawidth set, default=20)</p>
</div></blockquote>
<p><strong>chopforward</strong> : float</p>
<blockquote>
<div><p>If &gt;0 this gives the angle (in degrees from forward)
within which the scattering phase function should be
kept constant, essentially removing the strongly peaked
forward scattering. This is useful for large grains
(large ratio 2*pi*agraincm/lamcm) where the forward
scattering peak is extremely strong, yet extremely
narrow. If we are not interested in very forward-peaked
scattering (e.g. only relevant when modeling e.g. the
halo around the moon on a cold winter night), this will
remove this component and allow a lower angular grid
resolution for the theta grid.</p>
</div></blockquote>
<p><strong>errtol</strong> : float</p>
<blockquote>
<div><p>Tolerance of the relative difference between kscat
and the integral over the zscat Z11 element over angle.
If this tolerance is exceeded, a warning is given.</p>
</div></blockquote>
<p><strong>verbose</strong> : bool</p>
<blockquote>
<div><p>If set to True, the code will give some feedback so
that one knows what it is doing if it becomes slow.</p>
</div></blockquote>
<p><strong>extrapolate</strong> : bool</p>
<blockquote>
<div><p>If set to True, then if the wavelength grid lamcm goes
out of the range of the wavelength grid of the
optical constants file, then it will make a suitable
extrapolation: keeping the optical constants constant
for lamcm &lt; minimum, and extrapolating log-log for
lamcm &gt; maximum.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.makeopacRadmc2D">
<code class="descname">makeopacRadmc2D</code><span class="sig-paren">(</span><em>ext=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.makeopacRadmc2D" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates dust opacities (dustopac_*.inp files) for the previous 2D version of radmc
It takes the input dust opacity files and interpolates them onto the used frequency grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ext</strong> : list</p>
<blockquote class="last">
<div><p>List of dustkappa file name extensions, i.e. the input file name has to be named
as dustkappa_ext[i].inp</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.mixOpac">
<em class="property">static </em><code class="descname">mixOpac</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>mixnames=None</em>, <em>mixspecs=None</em>, <em>mixabun=None</em>, <em>writefile=True</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.mixOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Mixes dust opacities.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary, optional</p>
<blockquote>
<div><p>All parameters of the actual model setup.</p>
</div></blockquote>
<p><strong>mixnames</strong> : list, optional</p>
<blockquote>
<div><p>Names of the files into which the mixed dust opacities will be written
(not needed if writefile=False)</p>
</div></blockquote>
<p><strong>mixspecs</strong> : list, optional</p>
<blockquote>
<div><p>Names of the files from which the dust opacities are read (not needed if readfile=False)</p>
</div></blockquote>
<p><strong>mixabun</strong> : list, optional</p>
<blockquote>
<div><p>Abundances of different dust species</p>
</div></blockquote>
<p><strong>writefile</strong> : bool</p>
<blockquote>
<div><p>If False the mixed opacities will not be written out to files given in mixnames.</p>
</div></blockquote>
<p class="last"><strong>NOTE, either ppar or  mixname, mixspecs, and mixabun should be set.</strong></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.readMasterOpac">
<em class="property">static </em><code class="descname">readMasterOpac</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.readMasterOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the master opacity file &#8216;dustopac.inp&#8217;.
It reads the dustkappa filename extensions (dustkappa_ext.inp) corresponding to dust species indices</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><p><a href="#id1"><span class="problematic" id="id2">*</span></a>ext   : list of dustkappa file name extensions</p>
<p><a href="#id3"><span class="problematic" id="id4">*</span></a>therm : a list of integers specifying whether the dust grain is thermal or quantum heated
(0 - thermal, 1 - quantum heated)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.readOpac">
<code class="descname">readOpac</code><span class="sig-paren">(</span><em>ext=None</em>, <em>idust=None</em>, <em>scatmat=None</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.readOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the dust opacity files.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ext</strong> : list</p>
<blockquote>
<div><p>File name extension (file names should look like &#8216;dustkappa_ext.inp&#8217;)</p>
</div></blockquote>
<p><strong>idust: list</strong></p>
<blockquote>
<div><p>Indices of the dust species in the master opacity file (dustopac.inp&#8217;) - starts at 0</p>
</div></blockquote>
<p><strong>scatmat: list</strong></p>
<blockquote>
<div><p>If specified, its elements should be booleans indicating whether the opacity file
contains also the full scattering matrix (True) or only dust opacities (False)</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.runMakedust">
<em class="property">static </em><code class="descname">runMakedust</code><span class="sig-paren">(</span><em>freq=None</em>, <em>gmin=None</em>, <em>gmax=None</em>, <em>ngs=None</em>, <em>lnk_fname=None</em>, <em>gdens=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.runMakedust" title="Permalink to this definition">¶</a></dt>
<dd><p>Interface function to the F77 code makedust to calculate mass absorption coefficients.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>freq</strong> : ndarray</p>
<blockquote>
<div><p>Contains the frequency grid on which the opacities should be calculated</p>
</div></blockquote>
<p><strong>gmin</strong> : float</p>
<blockquote>
<div><p>Minimum grain size</p>
</div></blockquote>
<p><strong>gmax</strong> : float</p>
<blockquote>
<div><p>Maximum grain size</p>
</div></blockquote>
<p><strong>ngs</strong> : int</p>
<blockquote>
<div><p>Number of grain sizes</p>
</div></blockquote>
<p><strong>gdens</strong> : float</p>
<blockquote>
<div><p>Density of the dust grain in g/cm^3</p>
</div></blockquote>
<p><strong>lnk_fname</strong> : str</p>
<blockquote>
<div><p>Name of the file in which the optical constants are stored</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns an ndarray with [nfreq,ngs] dimensions containing the resulting opacities</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="staticmethod">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.writeMasterOpac">
<em class="property">static </em><code class="descname">writeMasterOpac</code><span class="sig-paren">(</span><em>ext=None</em>, <em>therm=None</em>, <em>scattering_mode_max=1</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.writeMasterOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the master opacity file &#8216;dustopac.inp&#8217;.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ext</strong> : list</p>
<blockquote>
<div><p>List of dustkappa file name extensions</p>
</div></blockquote>
<p><strong>therm</strong> : list</p>
<blockquote>
<div><p>List of integers specifying whether the dust grain is thermal or quantum heated
(0-thermal, 1-quantum)</p>
</div></blockquote>
<p><strong>scattering_mode_max</strong> : int</p>
<blockquote>
<div><p>Scattering mode code in radmc3d : 0 - no scattering, 1 - isotropic scattering,
2 - anisotropic scattering with Henyei-Greenstein phase function, 5 - anisotropic
scattering using the full scattering matrix and stokes vectors.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.dustopac.radmc3dDustOpac.writeOpac">
<code class="descname">writeOpac</code><span class="sig-paren">(</span><em>fname=None</em>, <em>ext=None</em>, <em>idust=None</em>, <em>scatmat=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.dustopac.radmc3dDustOpac.writeOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes dust opacities to file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>Name of the file to write the dust opacties into</p>
</div></blockquote>
<p><strong>ext</strong> : str</p>
<blockquote>
<div><p>If fname is not specified, the output file name will be generated as dustkappa_EXT.inp or
dustkapscatmat_EXT.inp depending on the file format</p>
</div></blockquote>
<p><strong>idust</strong> : int</p>
<blockquote>
<div><p>Dust species index whose opacities should be written to file</p>
</div></blockquote>
<p><strong>scatmat</strong> : bool</p>
<blockquote class="last">
<div><p>If True the full scattering matrix will be written to file on top of the opacities (i.e.
the file name should be dustkapscatmat_EXT.inp). If False only the dust opacities and the
asymmetry parameter (if present) will be written to file (dustkappa_EXT.inp type files)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.image">
<span id="radmc3dpy-image-module"></span><h2>radmc3dPy.image module<a class="headerlink" href="#module-radmc3dPy.image" title="Permalink to this headline">¶</a></h2>
<p>This module contains classes/functions to create and read images with RADMC-3D and to calculate
interferometric visibilities and write fits files
For help on the syntax or functionality of each function see the help of the individual functions</p>
<dl class="function">
<dt id="radmc3dPy.image.cmask">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">cmask</code><span class="sig-paren">(</span><em>im=None</em>, <em>rad=0.0</em>, <em>au=False</em>, <em>arcsec=False</em>, <em>dpc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.cmask" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Simulates a coronographic mask.</dt>
<dd>Sets the image values to zero within circle of a given radius around the
image center.</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>im</strong> : radmc3dImage</p>
<blockquote>
<div><p>A radmc3dImage class containing the image</p>
</div></blockquote>
<p><strong>rad</strong> : float</p>
<blockquote>
<div><p>The raadius of the mask</p>
</div></blockquote>
<p><strong>au</strong> : bool</p>
<blockquote>
<div><p>If true the radius is taken to have a unit of AU</p>
</div></blockquote>
<p><strong>arcsec</strong> : bool</p>
<blockquote>
<div><p>If true the radius is taken to have a unit of arcsec (dpc
should also be set)</p>
</div></blockquote>
<p><strong>dpc</strong> : float</p>
<blockquote>
<div><p>Distance of the source (required if arcsec = True)</p>
</div></blockquote>
<p><strong>NOTE if arcsec=False and au=False rad is taken to have a unit of pixel</strong></p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns a radmc3dImage class containing the masked image</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.image.getPSF">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">getPSF</code><span class="sig-paren">(</span><em>nx=None</em>, <em>ny=None</em>, <em>psfType='gauss'</em>, <em>pscale=None</em>, <em>fwhm=None</em>, <em>pa=None</em>, <em>tdiam_prim=8.2</em>, <em>tdiam_sec=0.94</em>, <em>wav=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.getPSF" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates a two dimensional Gaussian PSF.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>nx</strong> : int</p>
<blockquote>
<div><p>Image size in the first dimension</p>
</div></blockquote>
<p><strong>ny</strong> : int</p>
<blockquote>
<div><p>Image size in the second dimension</p>
</div></blockquote>
<p><strong>psfType</strong> : {&#8216;gauss&#8217;, &#8216;airy&#8217;}</p>
<blockquote>
<div><p>Shape of the PSF. If psfType=&#8217;gauss&#8217;, fwhm and pa should also be given. If psfType=&#8217;airy&#8217;, the 
tdiam_prim, tdiam_sec and wav parameters should also be specified.</p>
</div></blockquote>
<p><strong>pscale</strong> : list</p>
<blockquote>
<div><p>Pixelscale of the image, if set fwhm should be in the same unit, if not set unit of fwhm is pixels</p>
</div></blockquote>
<p><strong>fwhm</strong> : list, optional</p>
<blockquote>
<div><p>Full width at half maximum of the psf along the two axis (should be set only if psfType=&#8217;gauss&#8217;)</p>
</div></blockquote>
<p><strong>pa</strong> : float, optional</p>
<blockquote>
<div><p>Position angle of the gaussian if the gaussian is not symmetric 
(should be set only if psfType=&#8217;gauss&#8217;)</p>
</div></blockquote>
<p><strong>tdiam_prim</strong> : float, optional</p>
<blockquote>
<div><p>Diameter of the primary aperture of the telescope in meter. (should be set only if psfType=&#8217;airy&#8217;)</p>
</div></blockquote>
<p><strong>tdiam_sec</strong> : float, optional</p>
<blockquote>
<div><p>Diameter of the secondary mirror (central obscuration), if there is any, in meter. If no secondary
mirror/obscuration is present, this parameter should be set to zero. 
(should be set only if psfType=&#8217;airy&#8217;)</p>
</div></blockquote>
<p><strong>wav</strong> : float, optional</p>
<blockquote>
<div><p>Wavelength of observation in micrometer (should be set only if psfType=&#8217;airy&#8217;)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>psf <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>The two dimensional psf</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>x <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>The x-axis of the psf</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>y <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>The y-axis of the psf</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.image.makeImage">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">makeImage</code><span class="sig-paren">(</span><em>npix=None</em>, <em>incl=None</em>, <em>wav=None</em>, <em>sizeau=None</em>, <em>phi=None</em>, <em>posang=None</em>, <em>pointau=None</em>, <em>fluxcons=True</em>, <em>nostar=False</em>, <em>noscat=False</em>, <em>widthkms=None</em>, <em>linenlam=None</em>, <em>vkms=None</em>, <em>iline=None</em>, <em>lambdarange=None</em>, <em>nlam=None</em>, <em>stokes=False</em>, <em>binary=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.makeImage" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates a rectangular image with RADMC-3D</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>npix</strong> : int</p>
<blockquote>
<div><p>Number of pixels on the rectangular images</p>
</div></blockquote>
<p><strong>sizeau</strong> : float</p>
<blockquote>
<div><p>Diameter of the image in au</p>
</div></blockquote>
<p><strong>incl</strong> : float</p>
<blockquote>
<div><p>Inclination angle of the source</p>
</div></blockquote>
<p><strong>wav</strong> : float</p>
<blockquote>
<div><p>Wavelength of the image in micron</p>
</div></blockquote>
<p><strong>phi</strong> : float, optional</p>
<blockquote>
<div><p>Azimuthal rotation angle of the source in the model space</p>
</div></blockquote>
<p><strong>posang</strong> : float, optional</p>
<blockquote>
<div><p>Position angle of the source in the image plane</p>
</div></blockquote>
<p><strong>pointau</strong> : Float, optional</p>
<blockquote>
<div><p>Three elements list of the cartesian coordinates of the image center</p>
</div></blockquote>
<p><strong>widthkms</strong> : float, optional</p>
<blockquote>
<div><p>Width of the frequency axis of the channel maps</p>
</div></blockquote>
<p><strong>linenlam</strong> : int, optional</p>
<blockquote>
<div><p>Number of wavelengths to calculate images at</p>
</div></blockquote>
<p><strong>vkms</strong> : float, optional</p>
<blockquote>
<div><p>A single velocity value at which a channel map should be calculated</p>
</div></blockquote>
<p><strong>iline</strong> : int, optional</p>
<blockquote>
<div><p>Line transition index</p>
</div></blockquote>
<p><strong>lambdarange</strong> : list, optional</p>
<blockquote>
<div><p>Two element list with the wavelenght boundaries between which
multiwavelength images should be calculated</p>
</div></blockquote>
<p><strong>nlam</strong> : int, optional</p>
<blockquote>
<div><p>Number of wavelengths to be calculated in lambdarange</p>
</div></blockquote>
<p><strong>fluxcons</strong> : bool, optional</p>
<blockquote>
<div><p>This should not even be a keyword argument, it ensures flux conservation 
(adaptive subpixeling) in the rectangular images</p>
</div></blockquote>
<p><strong>nostar</strong> : bool, optional</p>
<blockquote>
<div><p>If True the calculated images will not contain stellar emission</p>
</div></blockquote>
<p><strong>noscat</strong> : bool, optional</p>
<blockquote>
<div><dl class="docutils">
<dt>If True, scattered emission will be neglected in the source function, however, </dt>
<dd><p class="first last">extinction will contain scattering if kappa_scat is not zero.</p>
</dd>
</dl>
</div></blockquote>
<p><strong>stokes</strong> : bool, optional</p>
<blockquote>
<div><p>If True, images in all four stokes parameters (IQUV) will be calculated, if
False only the intensity will be calculated</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If True the output image will be written in a C-style binary format, if False
the image format will be ASCII</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.image.plotImage">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">plotImage</code><span class="sig-paren">(</span><em>image=None</em>, <em>arcsec=False</em>, <em>au=False</em>, <em>log=False</em>, <em>dpc=None</em>, <em>maxlog=None</em>, <em>saturate=None</em>, <em>bunit='norm'</em>, <em>ifreq=0</em>, <em>cmask_rad=None</em>, <em>interpolation='nearest'</em>, <em>cmap=&lt;matplotlib.colors.LinearSegmentedColormap object&gt;</em>, <em>stokes='I'</em>, <em>fig=None</em>, <em>ax=None</em>, <em>projection='polar'</em>, <em>deg=True</em>, <em>rmax=None</em>, <em>rlog=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.plotImage" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots a radmc3d image.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>image</strong> : radmc3dImage</p>
<blockquote>
<div><p>A radmc3dImage class returned by readimage</p>
</div></blockquote>
<p><strong>arcsec</strong> : bool</p>
<blockquote>
<div><p>If True image axis will have the unit arcsec (NOTE: dpc keyword should also be set!)</p>
</div></blockquote>
<p><strong>au</strong> : bool</p>
<blockquote>
<div><p>If True image axis will have the unit AU</p>
</div></blockquote>
<p><strong>log</strong> : bool</p>
<blockquote>
<div><p>If True image scale will be logarithmic, otherwise linear</p>
</div></blockquote>
<p><strong>dpc</strong> : float</p>
<blockquote>
<div><p>Distance to the source in parsec (This keywords should be set if arcsec=True, or bunit!=&#8217;norm&#8217;)</p>
</div></blockquote>
<p><strong>maxlog</strong> : float</p>
<blockquote>
<div><p>Logarithm of the lowest pixel value to be plotted, lower pixel values will be clippde</p>
</div></blockquote>
<p><strong>saturate</strong> : float</p>
<blockquote>
<div><p>Highest pixel values to be plotted in terms of the peak value, higher pixel values will be clipped</p>
</div></blockquote>
<p><strong>bunit</strong> : {&#8216;norm&#8217;, &#8216;inu&#8217;, &#8216;snu&#8217;, &#8216;jy/beam&#8217;, &#8216;jy/pixel&#8217;}</p>
<blockquote>
<div><p>Unit of the image, (&#8216;norm&#8217; - Inu/max(Inu), &#8216;inu&#8217; - Inu, &#8216;snu&#8217; - Jy/pixel, &#8216;jy/pixel&#8217; - Jy/pixel,
&#8216;jy/beam&#8217; - Jy/beam), default is &#8216;norm&#8217;. The &#8216;snu&#8217; keyword value is kept for backward compatibility
as it is fully equivalent with the &#8216;jy/pixel&#8217; keyword value.</p>
</div></blockquote>
<p><strong>ifreq</strong> : int</p>
<blockquote>
<div><p>If the image file/array consists of multiple frequencies/wavelengths ifreq denotes the index
of the frequency/wavelength in the image array to be plotted</p>
</div></blockquote>
<p><strong>cmask_rad</strong> : float</p>
<blockquote>
<div><p>Simulates coronographyic mask : sets the image values to zero within this radius of the image center
The unit is the same as the image axis (au, arcsec, cm)
NOTE: this works only on the plot, the image array is not changed (for that used the cmask() 
function)</p>
</div></blockquote>
<p><strong>interpolation</strong> : str</p>
<blockquote>
<div><p>interpolation keyword for imshow (e.g. &#8216;nearest&#8217;, &#8216;bilinear&#8217;, &#8216;bicubic&#8217;)</p>
</div></blockquote>
<p><strong>cmap</strong> : matplotlib color map</p>
<p><strong>stokes</strong> : {&#8216;I&#8217;, &#8216;Q&#8217;, &#8216;U&#8217;, &#8216;V&#8217;, &#8216;PI&#8217;, &#8216;P&#8217;}</p>
<blockquote>
<div><p>What to plot for full stokes images, Stokes I/Q/U/V,
PI  - polarised intensity (PI = sqrt(Q^2 + U^2 + V^2))
P   - polarisation fraction (i.e. sqrt(Q^2 + U^2 + V^2) / I)
PIL - polarised intensity (PI = sqrt(Q^2 + U^2))
PL  - fraction of linear polarisation (i.e. sqrt(Q^2 + U^2) / I)</p>
</div></blockquote>
<p><strong>fig</strong> : matplotlig.figure.Figure, optional</p>
<blockquote>
<div><p>An instance of a matplotlib Figure. If not provided a new Figure will be generated. If provided 
plotImage will add a single Axes to the Figure, using add_subplots() with the appropriate projection.
If the desired plot is to be made for a multi-panel plot, the appropriate Axes instance can be 
passed to the ax keyword. This keyword is only used for circular images.</p>
</div></blockquote>
<p><strong>ax</strong> : matplotlib.axes.Axes, optional</p>
<blockquote>
<div><p>An instance of a matplotlib Axes to draw the plot on. Note, that the projection of the axes should 
be the same as the projection keyword passed to plotImage. This keyword is only used for circular 
images.</p>
</div></blockquote>
<p><strong>projection</strong> : {&#8216;polar&#8217;, &#8216;cartesian&#8217;}</p>
<blockquote>
<div><p>Projection of the plot. For cartesian plots a rectangular plot will be drawn, with the horizontal 
axis being the azimuth angle, and the vertical axis the radius.</p>
</div></blockquote>
<p><strong>deg</strong> : bool</p>
<blockquote>
<div><p>If True the unit of the azimuthal coordinates will degree, if False it will be radian. Used only for
circular images and for cartesian projection.</p>
</div></blockquote>
<p><strong>rmax</strong> : float</p>
<blockquote>
<div><p>Maximum value of the radial coordinate for polar projection. Used only for circular images.</p>
</div></blockquote>
<p><strong>rlog</strong> : bool</p>
<blockquote class="last">
<div><p>If True the radial coordiante axis will be set to logarithmic for cartesian projection. Used only 
for circular images.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.image.plotPolDir">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">plotPolDir</code><span class="sig-paren">(</span><em>image=None</em>, <em>arcsec=False</em>, <em>au=False</em>, <em>dpc=None</em>, <em>ifreq=0</em>, <em>cmask_rad=None</em>, <em>color='w'</em>, <em>nx=20</em>, <em>ny=20</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.plotPolDir" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to plot the polarisation direction for full stokes images</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>image</strong> : radmc3dImage</p>
<blockquote>
<div><p>A radmc3dImage class returned by readimage</p>
</div></blockquote>
<p><strong>arcsec</strong> : bool</p>
<blockquote>
<div><p>If True image axis will have the unit arcsec (NOTE: dpc keyword should also be set!)</p>
</div></blockquote>
<p><strong>au</strong> : bool</p>
<blockquote>
<div><p>If True image axis will have the unit AU</p>
</div></blockquote>
<p><strong>dpc</strong> : float</p>
<blockquote>
<div><p>Distance to the source in parsec (This keywords should be set if arcsec=True, or bunit!=&#8217;norm&#8217;)</p>
</div></blockquote>
<p><strong>ifreq</strong> : int</p>
<blockquote>
<div><p>If the image file/array consists of multiple frequencies/wavelengths ifreq denotes the index
of the frequency/wavelength in the image array to be plotted</p>
</div></blockquote>
<p><strong>cmask_rad</strong> : float</p>
<blockquote>
<div><p>Simulates coronographyic mask : sets the image values to zero within this radius of the image center
The unit is the same as the image axis (au, arcsec, cm)
NOTE: this works only on the plot, the image array is not changed (for that used the cmask() 
function)</p>
</div></blockquote>
<p><strong>color</strong> : str</p>
<blockquote>
<div><p>Color for the polarisation direction plot</p>
</div></blockquote>
<p><strong>nx</strong> : int</p>
<blockquote>
<div><p>Number of grid points along the horizontal axis at which the direction should be displayed</p>
</div></blockquote>
<p><strong>ny</strong> : int</p>
<blockquote class="last">
<div><p>Number of grid points along the vertical axis at which the direction should be displayed</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="class">
<dt id="radmc3dPy.image.radmc3dCircimage">
<em class="property">class </em><code class="descclassname">radmc3dPy.image.</code><code class="descname">radmc3dCircimage</code><a class="headerlink" href="#radmc3dPy.image.radmc3dCircimage" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>RADMC-3D circular image class</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="8%" />
<col width="92%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>image</td>
<td>(ndarray) The image as calculated by radmc3d (the values are intensities in erg/s/cm^2/Hz/ster)</td>
</tr>
<tr class="row-even"><td>rc</td>
<td>(ndarray) Radial cell center coordinate of the image [cm]</td>
</tr>
<tr class="row-odd"><td>ri</td>
<td>(ndarray) Radial cell interface coordinate of the image [cm]</td>
</tr>
<tr class="row-even"><td>phic</td>
<td>(ndarray) Azimuthal cell center coordinate of the image [rad]</td>
</tr>
<tr class="row-odd"><td>phii</td>
<td>(ndarray) Azimuthal cell interface coordinate of the image [rad]</td>
</tr>
<tr class="row-even"><td>nr</td>
<td>(int) Number of pixels in the radial direction</td>
</tr>
<tr class="row-odd"><td>nphi</td>
<td>(int) Number of pixels in the azimuthal direction</td>
</tr>
<tr class="row-even"><td>nfreq</td>
<td>(int) Number of frequencies in the image cube</td>
</tr>
<tr class="row-odd"><td>freq</td>
<td>(ndarray) Frequency grid in the image cube</td>
</tr>
<tr class="row-even"><td>nwav</td>
<td>(int) Number of wavelengths in the image cube (same as nfreq)</td>
</tr>
<tr class="row-odd"><td>wav</td>
<td>(ndarray) Wavelength grid in the image cube</td>
</tr>
<tr class="row-even"><td>filename</td>
<td>(str) Name of the file the image data was read from</td>
</tr>
<tr class="row-odd"><td>stokes</td>
<td>(bool) If True the image data contain the full stokes vector (I,Q,U,V)</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dCircimage.getPixelSize" title="radmc3dPy.image.radmc3dCircimage.getPixelSize"><code class="xref py py-obj docutils literal"><span class="pre">getPixelSize</span></code></a>()</td>
<td>Calculates the pixel size</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dCircimage.readImage" title="radmc3dPy.image.radmc3dCircimage.readImage"><code class="xref py py-obj docutils literal"><span class="pre">readImage</span></code></a>([filename,&nbsp;old])</td>
<td>Reads a circular image</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.image.radmc3dCircimage.getPixelSize">
<code class="descname">getPixelSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dCircimage.getPixelSize" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the pixel size</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The pixel size in cm^2</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dCircimage.readImage">
<code class="descname">readImage</code><span class="sig-paren">(</span><em>filename='circimage.out'</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dCircimage.readImage" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads a circular image</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>filename</strong> : str</p>
<blockquote>
<div><p>Name of the file to be read.</p>
</div></blockquote>
<p><strong>old</strong> : bool</p>
<blockquote class="last">
<div><p>If True the image format of the old 2D code (radmc) will be used. If False (default) the 
RADMC-3D format is used.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="radmc3dPy.image.radmc3dImage">
<em class="property">class </em><code class="descclassname">radmc3dPy.image.</code><code class="descname">radmc3dImage</code><a class="headerlink" href="#radmc3dPy.image.radmc3dImage" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>RADMC-3D image class</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>image</td>
<td>(ndarray) The image as calculated by radmc3d (the values are intensities in erg/s/cm^2/Hz/ster)</td>
</tr>
<tr class="row-even"><td>imageJyppix</td>
<td>(ndarray) The image with pixel units of Jy/pixel</td>
</tr>
<tr class="row-odd"><td>x</td>
<td>(ndarray) x coordinate of the image [cm]</td>
</tr>
<tr class="row-even"><td>y</td>
<td>(ndarray) y coordinate of the image [cm]</td>
</tr>
<tr class="row-odd"><td>nx</td>
<td>(int) Number of pixels in the horizontal direction</td>
</tr>
<tr class="row-even"><td>ny</td>
<td>(int) Number of pixels in the vertical direction</td>
</tr>
<tr class="row-odd"><td>sizepix_x</td>
<td>(float) Pixel size in the horizontal direction [cm]</td>
</tr>
<tr class="row-even"><td>sizepix_y</td>
<td>(float) Pixel size in the vertical direction [cm]</td>
</tr>
<tr class="row-odd"><td>nfreq</td>
<td>(int) Number of frequencies in the image cube</td>
</tr>
<tr class="row-even"><td>freq</td>
<td>(ndarray) Frequency grid in the image cube</td>
</tr>
<tr class="row-odd"><td>nwav</td>
<td>(int) Number of wavelengths in the image cube (same as nfreq)</td>
</tr>
<tr class="row-even"><td>wav</td>
<td>(ndarray) Wavelength grid in the image cube</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.getClosurePhase" title="radmc3dPy.image.radmc3dImage.getClosurePhase"><code class="xref py py-obj docutils literal"><span class="pre">getClosurePhase</span></code></a>([bl,&nbsp;pa,&nbsp;dpc])</td>
<td>Calculates clusure phases for a given model image for any arbitrary baseline triplet.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.getMomentMap" title="radmc3dPy.image.radmc3dImage.getMomentMap"><code class="xref py py-obj docutils literal"><span class="pre">getMomentMap</span></code></a>([moment,&nbsp;nu0,&nbsp;wav0])</td>
<td>Calculates moment maps.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.getVisibility" title="radmc3dPy.image.radmc3dImage.getVisibility"><code class="xref py py-obj docutils literal"><span class="pre">getVisibility</span></code></a>([bl,&nbsp;pa,&nbsp;dpc])</td>
<td>Calculates visibilities for a given set of projected baselines and position angles with Discrete Fourier Transform.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.imConv" title="radmc3dPy.image.radmc3dImage.imConv"><code class="xref py py-obj docutils literal"><span class="pre">imConv</span></code></a>([dpc,&nbsp;psfType,&nbsp;fwhm,&nbsp;pa,&nbsp;tdiam_prim,&nbsp;...])</td>
<td>Convolves a RADMC-3D image with a two dimensional Gaussian psf.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.plotMomentMap" title="radmc3dPy.image.radmc3dImage.plotMomentMap"><code class="xref py py-obj docutils literal"><span class="pre">plotMomentMap</span></code></a>([moment,&nbsp;nu0,&nbsp;wav0,&nbsp;dpc,&nbsp;au,&nbsp;...])</td>
<td>Plots moment maps</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.readImage" title="radmc3dPy.image.radmc3dImage.readImage"><code class="xref py py-obj docutils literal"><span class="pre">readImage</span></code></a>([fname,&nbsp;binary,&nbsp;old])</td>
<td>Reads an image calculated by RADMC-3D</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.image.radmc3dImage.writeFits" title="radmc3dPy.image.radmc3dImage.writeFits"><code class="xref py py-obj docutils literal"><span class="pre">writeFits</span></code></a>([fname,&nbsp;dpc,&nbsp;coord,&nbsp;bandwidthmhz,&nbsp;...])</td>
<td>Writes out a RADMC-3D image data in fits format.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.getClosurePhase">
<code class="descname">getClosurePhase</code><span class="sig-paren">(</span><em>bl=None</em>, <em>pa=None</em>, <em>dpc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.getClosurePhase" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates clusure phases for a given model image for any arbitrary baseline triplet.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>bl</strong> : list/ndarray</p>
<blockquote>
<div><p>A list or ndrray containing the length of projected baselines in meter.</p>
</div></blockquote>
<p><strong>pa</strong> : list/ndarray</p>
<blockquote>
<div><p>A list or Numpy array containing the position angles of projected baselines in degree.</p>
</div></blockquote>
<p><strong>dpc</strong> : distance of the source in parsec</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li>bl     : projected baseline in meter</li>
<li>pa     : position angle of the projected baseline in degree</li>
<li>nbl    : number of baselines</li>
<li>u      : spatial frequency along the x axis of the image</li>
<li>v      : spatial frequency along the v axis of the image</li>
<li>vis    : complex visibility at points (u,v)</li>
<li>amp    : correlation amplitude</li>
<li>phase  : Fourier phase</li>
<li>cp     : closure phase</li>
<li>wav    : wavelength</li>
<li>nwav   : number of wavelengths</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>bl and pa should either be an array with dimension [N,3] or if they are lists each element of
the list should be a list of length 3, since closure phases are calculated only for closed triangles</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.getMomentMap">
<code class="descname">getMomentMap</code><span class="sig-paren">(</span><em>moment=0</em>, <em>nu0=None</em>, <em>wav0=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.getMomentMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates moment maps.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>moment</strong> : int</p>
<blockquote>
<div><p>Moment of the channel maps to be calculated</p>
</div></blockquote>
<p><strong>nu0</strong> : float</p>
<blockquote>
<div><p>Rest frequency of the line in Hz</p>
</div></blockquote>
<p><strong>wav0</strong> : float</p>
<blockquote>
<div><p>Rest wavelength of the line in micron</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Ndarray with the same dimension as the individual channel maps</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.getVisibility">
<code class="descname">getVisibility</code><span class="sig-paren">(</span><em>bl=None</em>, <em>pa=None</em>, <em>dpc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.getVisibility" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates visibilities for a given set of projected baselines and position angles
with Discrete Fourier Transform.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>bl</strong> : list/ndarray</p>
<blockquote>
<div><p>A list or ndrray containing the length of projected baselines in meter.</p>
</div></blockquote>
<p><strong>pa</strong> : list/ndarray</p>
<blockquote>
<div><p>A list or Numpy array containing the position angles of projected baselines in degree.</p>
</div></blockquote>
<p><strong>dpc</strong> : distance of the source in parsec</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li>bl     : projected baseline in meter</li>
<li>pa     : position angle of the projected baseline in degree</li>
<li>nbl    : number of baselines</li>
<li>u      : spatial frequency along the x axis of the image</li>
<li>v      : spatial frequency along the v axis of the image</li>
<li>vis    : complex visibility at points (u,v)</li>
<li>amp    : correlation amplitude</li>
<li>phase  : Fourier phase</li>
<li>wav    : wavelength</li>
<li>nwav   : number of wavelengths</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.imConv">
<code class="descname">imConv</code><span class="sig-paren">(</span><em>dpc=1.0</em>, <em>psfType='gauss'</em>, <em>fwhm=None</em>, <em>pa=None</em>, <em>tdiam_prim=8.2</em>, <em>tdiam_sec=0.94</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.imConv" title="Permalink to this definition">¶</a></dt>
<dd><p>Convolves a RADMC-3D image with a two dimensional Gaussian psf. The output images will have the same
brightness units as the input images.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>dpc</strong> : float</p>
<blockquote>
<div><p>Distance of the source in pc.</p>
</div></blockquote>
<p><strong>psfType</strong> : {&#8216;gauss&#8217;, &#8216;airy&#8217;}</p>
<blockquote>
<div><p>Shape of the PSF. If psfType=&#8217;gauss&#8217;, fwhm and pa should also be given. If psfType=&#8217;airy&#8217;, the 
tdiam_prim, tdiam_sec and wav parameters should also be specified.</p>
</div></blockquote>
<p><strong>fwhm</strong> : list, optional</p>
<blockquote>
<div><p>A list of two numbers; the FWHM of the two dimensional psf along the two principal axes.
The unit is assumed to be arcsec. (should only be set if psfType=&#8217;gauss&#8217;)</p>
</div></blockquote>
<p><strong>pa</strong> : float, optional</p>
<blockquote>
<div><p>Position angle of the psf ellipse (counts from North counterclockwise, should only be set 
if psfType=&#8217;gauss&#8217;)</p>
</div></blockquote>
<p><strong>tdiam_prim</strong> : float, optional</p>
<blockquote>
<div><p>Diameter of the primary aperture of the telescope in meter. (should be set only if psfType=&#8217;airy&#8217;)</p>
</div></blockquote>
<p><strong>tdiam_sec</strong> : float, optional</p>
<blockquote>
<div><p>Diameter of the secondary mirror (central obscuration), if there is any, in meter. If no 
secondary mirror/obscuration is present, this parameter should be set to zero. 
(should only be set if psfType=&#8217;airy&#8217;)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns a radmc3dImage</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.plotMomentMap">
<code class="descname">plotMomentMap</code><span class="sig-paren">(</span><em>moment=0</em>, <em>nu0=None</em>, <em>wav0=None</em>, <em>dpc=1.0</em>, <em>au=False</em>, <em>arcsec=False</em>, <em>cmap=None</em>, <em>vclip=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.plotMomentMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots moment maps</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>moment</strong> : int</p>
<blockquote>
<div><p>Moment of the channel maps to be calculated</p>
</div></blockquote>
<p><strong>nu0</strong> : float</p>
<blockquote>
<div><p>Rest frequency of the line in Hz</p>
</div></blockquote>
<p><strong>wav0</strong> : float</p>
<blockquote>
<div><p>Rest wavelength of the line in micron</p>
</div></blockquote>
<p><strong>dpc</strong> : float</p>
<blockquote>
<div><p>Distance of the source in pc</p>
</div></blockquote>
<p><strong>au</strong> : bool</p>
<blockquote>
<div><p>If True displays the image with AU as the spatial axis unit</p>
</div></blockquote>
<p><strong>arcsec</strong> : bool</p>
<blockquote>
<div><p>If True displays the image with arcsec as the spatial axis unit (dpc should also be set!)</p>
</div></blockquote>
<p><strong>cmap</strong> : matplotlib colormap</p>
<blockquote>
<div><p>Color map to be used to display the moment map</p>
</div></blockquote>
<p><strong>vclip</strong> : list/ndarray</p>
<blockquote class="last">
<div><dl class="docutils">
<dt>Two element list / Numpy array containin the lower and upper limits for the values in the moment</dt>
<dd><p class="first last">map to be displayed</p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.readImage">
<code class="descname">readImage</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=False</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.readImage" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads an image calculated by RADMC-3D</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name of the radmc3d output image (if omitted &#8216;image.out&#8217; is used)</p>
</div></blockquote>
<p><strong>old</strong> : bool</p>
<blockquote>
<div><p>If set to True it reads old radmc-2d style image</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote class="last">
<div><p>False - the image format is formatted ASCII if True - C-compliant binary (omitted if old=True)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.image.radmc3dImage.writeFits">
<code class="descname">writeFits</code><span class="sig-paren">(</span><em>fname=''</em>, <em>dpc=1.0</em>, <em>coord='03h10m05s -10d05m30s'</em>, <em>bandwidthmhz=2000.0</em>, <em>casa=False</em>, <em>nu0=0.0</em>, <em>stokes='I'</em>, <em>fitsheadkeys=[]</em>, <em>ifreq=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.radmc3dImage.writeFits" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes out a RADMC-3D image data in fits format.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>File name of the radmc3d output image (if omitted &#8216;image.fits&#8217; is used)</p>
</div></blockquote>
<p><strong>dpc</strong> : float</p>
<blockquote>
<div><p>Distance of the source in pc</p>
</div></blockquote>
<p><strong>coord</strong> : str</p>
<blockquote>
<div><p>Image center coordinates</p>
</div></blockquote>
<p><strong>bandwidthmhz</strong> : float</p>
<blockquote>
<div><p>Bandwidth of the image in MHz (equivalent of the CDELT keyword in the fits header)</p>
</div></blockquote>
<p><strong>casa</strong> : bool</p>
<blockquote>
<div><p>If set to True a CASA compatible four dimensional image cube will be written</p>
</div></blockquote>
<p><strong>nu0</strong> : float</p>
<blockquote>
<div><p>Rest frequency of the line (for channel maps)</p>
</div></blockquote>
<p><strong>stokes</strong> : {&#8216;I&#8217;, &#8216;Q&#8217;, &#8216;U&#8217;, &#8216;V&#8217;, &#8216;PI&#8217;}</p>
<blockquote>
<div><p>Stokes parameter to be written if the image contains Stokes IQUV (possible 
choices: &#8216;I&#8217;, &#8216;Q&#8217;, &#8216;U&#8217;, &#8216;V&#8217;, &#8216;PI&#8217; -Latter being the polarized intensity)</p>
</div></blockquote>
<p><strong>fitsheadkeys</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all (extra) keywords to be added to the fits header. If 
the keyword is already in the fits header (e.g. CDELT1) it will be updated/changed
to the value in fitsheadkeys, if the keyword is not present the keyword is added to 
the fits header.</p>
</div></blockquote>
<p><strong>ifreq</strong> : int</p>
<blockquote class="last">
<div><p>Frequency index of the image array to write. If set only this frequency of a multi-frequency
array will be written to file.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="radmc3dPy.image.readImage">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">readImage</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=False</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.readImage" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Reads an image calculated by RADMC-3D.</dt>
<dd>This function is an interface to radmc3dImage.readImage().</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><blockquote>
<div><p>File name of the radmc3d output image (if omitted &#8216;image.out&#8217; is used)</p>
</div></blockquote>
<dl class="docutils">
<dt>old <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt>
<dd><p class="first last">If set to True it reads old radmc-2d style image</p>
</dd>
<dt>binary <span class="classifier-delimiter">:</span> <span class="classifier">bool, optional</span></dt>
<dd><p class="first last">False - the image format is formatted ASCII if True - C-compliant binary (omitted if old=True)</p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.image.readcircimage">
<code class="descclassname">radmc3dPy.image.</code><code class="descname">readcircimage</code><span class="sig-paren">(</span><em>filename='circimage.out'</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.image.readcircimage" title="Permalink to this definition">¶</a></dt>
<dd><p>A convenience function to read circular images</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>filename</strong> : str</p>
<blockquote>
<div><p>Name of the file to be read.</p>
</div></blockquote>
<p><strong>old</strong> : bool</p>
<blockquote class="last">
<div><p>If True the image format of the old 2D code (radmc) will be used. If False (default) the 
RADMC-3D format is used.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.miescat">
<span id="radmc3dpy-miescat-module"></span><h2>radmc3dPy.miescat module<a class="headerlink" href="#module-radmc3dPy.miescat" title="Permalink to this headline">¶</a></h2>
<p>This module contains functions for Mie-scattering and to write dust opacity files</p>
<dl class="function">
<dt id="radmc3dPy.miescat.bhmie">
<code class="descclassname">radmc3dPy.miescat.</code><code class="descname">bhmie</code><span class="sig-paren">(</span><em>x=None</em>, <em>refrel=None</em>, <em>theta=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.miescat.bhmie" title="Permalink to this definition">¶</a></dt>
<dd><p>The famous Bohren and Huffman Mie scattering code.
This version was ported to Python from the f77 code from Bruce
Draine, which can be downloaded from:</p>
<blockquote>
<div><a class="reference external" href="https://www.astro.princeton.edu/~draine/scattering.html">https://www.astro.princeton.edu/~draine/scattering.html</a></div></blockquote>
<p>The code originates from the book by Bohren &amp; Huffman (1983) on
&#8220;Absorption and Scattering of Light by Small Particles&#8221;.
This python version was created by Cornelis Dullemond,
February 2017.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>x</strong> : ndarray</p>
<blockquote>
<div><p>Size parameter (2*pi*radius_grain/lambda)</p>
</div></blockquote>
<p><strong>refrel</strong> : complex</p>
<blockquote>
<div><p>Complex index of refraction (example: 1.5 + 0.01*1j)</p>
</div></blockquote>
<p><strong>theta</strong> : ndarray</p>
<blockquote>
<div><p>Scattering angles between 0 and 180 deg</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A list with the following elements:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>[0] S1 <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Complex phase function S1 (E perpendicular to scattering plane) as a function of theta</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>[1] S2 <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Complex phase function S1 (E parallel to scattering plane) as a function of theta</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>[2] Qext <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Efficiency factor for extinction (C_ext/pi*a**2)</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>[3] Qsca <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Efficiency factor for scatterin(C_sca/pi*a**2)</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>[4] Qback <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Backscattering efficiency ((dC_sca/domega)/pi*a**2 )
Note, this is (1/4*pi) smaller than the &#8220;radar backscattering efficiency&#8221; - see Bohren &amp;
Huffman 1983 pp. 120-123]</dd>
</dl>
</li>
<li>[5] gsca  :  &lt;cos(theta)&gt; for scattering</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.miescat.compute_opac_mie">
<code class="descclassname">radmc3dPy.miescat.</code><code class="descname">compute_opac_mie</code><span class="sig-paren">(</span><em>fname=''</em>, <em>matdens=None</em>, <em>agraincm=None</em>, <em>lamcm=None</em>, <em>theta=None</em>, <em>logawidth=None</em>, <em>wfact=3.0</em>, <em>na=20</em>, <em>chopforward=0.0</em>, <em>errtol=0.01</em>, <em>verbose=False</em>, <em>extrapolate=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.miescat.compute_opac_mie" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute dust opacity with Mie theory based on the optical constants
in the optconst_file. Optionally also the scattering phase function
in terms of the Mueller matrix elements can be computed. To smear out
the resonances that appear due to the perfect sphere shape, you can
optionally smear out the grain size distribution a bit with setting
the width of a Gaussian grain size distribution.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>File name of the optical constants file. This file
should contain three columns: first the wavelength
in micron, then the n-coefficient and then the
k-coefficient. See Jena optical constants database:
<a class="reference external" href="http://www.astro.uni-jena.de/Laboratory/Database/databases.html">http://www.astro.uni-jena.de/Laboratory/Database/databases.html</a></p>
</div></blockquote>
<p><strong>matdens</strong> : float</p>
<blockquote>
<div><p>Material density in g/cm^3</p>
</div></blockquote>
<p><strong>agraincm</strong> : float</p>
<blockquote>
<div><p>Grain radius in cm</p>
</div></blockquote>
<p><strong>lamcm</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid in cm</p>
</div></blockquote>
<p><strong>theta</strong> : ndarray, optional</p>
<blockquote>
<div><p>Angular grid (a numpy array) between 0 and 180
which are the scattering angle sampling points at
which the scattering phase function is computed.</p>
</div></blockquote>
<p><strong>logawidth</strong> : float, optional</p>
<blockquote>
<div><p>If set, the size agrain will instead be a
sample of sizes around agrain. This helps to smooth out
the strong wiggles in the phase function and opacity
of spheres at an exact size. Since in Nature it rarely
happens that grains all have exactly the same size, this
is quite natural. The value of logawidth sets the width
of the Gauss in ln(agrain), so for logawidth&lt;&lt;1 this
give a real width of logawidth*agraincm.</p>
</div></blockquote>
<p><strong>wfact</strong> : float</p>
<blockquote>
<div><p>Grid width of na sampling points in units
of logawidth. The Gauss distribution of grain sizes is
cut off at agrain * exp(wfact*logawidth) and
agrain * exp(-wfact*logawidth). Default = 3</p>
</div></blockquote>
<p><strong>na</strong> : int</p>
<blockquote>
<div><p>Number of size sampling points (if logawidth set, default=20)</p>
</div></blockquote>
<p><strong>chopforward</strong> : float</p>
<blockquote>
<div><p>If &gt;0 this gives the angle (in degrees from forward)
within which the scattering phase function should be
kept constant, essentially removing the strongly peaked
forward scattering. This is useful for large grains
(large ratio 2*pi*agraincm/lamcm) where the forward
scattering peak is extremely strong, yet extremely
narrow. If we are not interested in very forward-peaked
scattering (e.g. only relevant when modeling e.g. the
halo around the moon on a cold winter night), this will
remove this component and allow a lower angular grid
resolution for the theta grid.</p>
</div></blockquote>
<p><strong>errtol</strong> : float</p>
<blockquote>
<div><p>Tolerance of the relative difference between kscat
and the integral over the zscat Z11 element over angle.
If this tolerance is exceeded, a warning is given.</p>
</div></blockquote>
<p><strong>verbose</strong> : bool</p>
<blockquote>
<div><p>If set to True, the code will give some feedback so
that one knows what it is doing if it becomes slow.</p>
</div></blockquote>
<p><strong>extrapolate</strong> : bool</p>
<blockquote>
<div><p>If set to True, then if the wavelength grid lamcm goes
out of the range of the wavelength grid of the
optical constants file, then it will make a suitable
extrapolation: keeping the optical constants constant
for lamcm &lt; minimum, and extrapolating log-log for
lamcm &gt; maximum.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary with the following keys:</p>
<blockquote class="last">
<div><ul>
<li><dl class="first docutils">
<dt>kabs <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">Absorption opacity kappa_abs_nu (a numpy array) in
units of cm^2/gram</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>ksca <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">Scattering opacity kappa_abs_nu (a numpy array) in
units of cm^2/gram</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>gsca <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">The &lt;cos(theta)&gt; g-factor of scattering</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>theta <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if theta is given at input)</span></dt>
<dd><p class="first last">The theta grid itself (just a copy of what was given)</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>zscat <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if theta is given at input)</span></dt>
<dd><p class="first">The components of the scattering Mueller matrix
Z_ij for each wavelength and each scattering angel.
The normalization of Z is such that kscat can be
reproduced (as can be checked) by the integral:
2*pi*int_{-1}^{+1}Z11(mu)dmu=kappa_scat.
For symmetry reasons only 6 elements of the Z
matrix are returned: Z11, Z12, Z22, Z33, Z34, Z44.
Note that Z21 = Z12 and Z43 = -Z34.
The scattering matrix is normalized such that
if a plane wave with Stokes flux</p>
<blockquote>
<div><p>Fin = (Fin_I,Fin_Q,Fin_U,Fin_V)</p>
</div></blockquote>
<p>hits a dust grain (which has mass mgrain), then
the scattered flux</p>
<blockquote>
<div><p>Fout = (Fout_I,Fout_Q,Fout_U,Fout_V)</p>
</div></blockquote>
<p>at distance r from the grain at angle theta
is given by</p>
<blockquote>
<div><p>Fout(theta) = (mgrain/r^2) * Zscat . Fin</p>
</div></blockquote>
<p class="last">where . is the matrix-vector multiplication.
Note that the Stokes components must be such
that the horizontal axis in the &#8220;image&#8221; is
pointing in the scattering plane. This means
that radiation with Fin_Q &lt; 0 is scattered well,
because it is vertically polarized (along the
scattering angle axis), while radiation with
Fin_Q &gt; 0 is scatterd less well because it
is horizontally polarized (along the scattering
plane).</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>kscat_from_z11 <span class="classifier-delimiter">:</span> <span class="classifier">ndarray  (optional, only if theta is given at input)</span></dt>
<dd><p class="first last">The kscat computed from the (above mentioned)
integral of Z11 over all angles. This should be
nearly identical to kscat if the angular grid
is sufficiently fine. If there are strong
differences, this is an indication that the
angular gridding (the theta grid) is not fine
enough. But you should have then automatically
gotten a warning message as well (see errtol).</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>wavmic <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if extrapolate is set to True)</span></dt>
<dd><p class="first last">The original wavelength grid from the optical constants file,
with possibly an added extrapolated</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>ncoef <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if extrapolate is set to True)</span></dt>
<dd><p class="first last">The optical constant n at that grid</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>kcoef <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if extrapolate is set to True)</span></dt>
<dd><p class="first last">The optical constant k at that grid</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>agr <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if logawidth is not None)</span></dt>
<dd><p class="first last">Grain sizes</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>wgt <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if logawidth is not None)</span></dt>
<dd><p class="first last">The averaging weights of these grain (not the masses!)
The sum of wgt.sum() must be 1.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>zscat_nochop <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if chopforward &gt; 0)</span></dt>
<dd><p class="first last">The zscat before the forward scattering was chopped off</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>kscat_nochop <span class="classifier-delimiter">:</span> <span class="classifier">ndarray (optional, only if chopforward &gt; 0)</span></dt>
<dd><p class="first last">The kscat originally from the bhmie code</p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.miescat.write_radmc3d_kappa_file">
<code class="descclassname">radmc3dPy.miescat.</code><code class="descname">write_radmc3d_kappa_file</code><span class="sig-paren">(</span><em>package=None</em>, <em>name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.miescat.write_radmc3d_kappa_file" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>The RADMC-3D radiative transfer package</dt>
<dd><a class="reference external" href="http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/">http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/</a></dd>
</dl>
<p>can perform dust continuum radiative transfer for diagnostic purposes.
It is designed for astronomical applications. The code
needs the opacities in a particular form. This subroutine
writes the opacities out in that form. It will write it to
the file dustkappa_&lt;name&gt;.inp. This is the simpler version of
the opacity files, containing only kabs, kscat, gscat as a function
of wavelength.</p>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.miescat.write_radmc3d_scatmat_file">
<code class="descclassname">radmc3dPy.miescat.</code><code class="descname">write_radmc3d_scatmat_file</code><span class="sig-paren">(</span><em>package=None</em>, <em>name=None</em>, <em>comment=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.miescat.write_radmc3d_scatmat_file" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>The RADMC-3D radiative transfer package</dt>
<dd><a class="reference external" href="http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/">http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/</a></dd>
</dl>
<p>can perform dust continuum radiative transfer for diagnostic purposes.
It is designed for astronomical applications. The code
needs the opacities in a particular form. This subroutine
writes the opacities out in that form. It will write it to
the file dustkapscatmat_&lt;name&gt;.inp.</p>
</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.molecule">
<span id="radmc3dpy-molecule-module"></span><h2>radmc3dPy.molecule module<a class="headerlink" href="#module-radmc3dPy.molecule" title="Permalink to this headline">¶</a></h2>
<p>This module contains classes to handle molecular data</p>
<dl class="class">
<dt id="radmc3dPy.molecule.radmc3dMolecule">
<em class="property">class </em><code class="descclassname">radmc3dPy.molecule.</code><code class="descname">radmc3dMolecule</code><a class="headerlink" href="#radmc3dPy.molecule.radmc3dMolecule" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>RADMC-3D molecule class
Based on the Leiden LAMDA database, but is in principle generic</p>
<dl class="docutils">
<dt>NOTE: For now only the levels and lines are included, not the</dt>
<dd>collision rates.</dd>
</dl>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="16%" />
<col width="84%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>name</td>
<td>(str) The name as listed in the molecule file</td>
</tr>
<tr class="row-even"><td>molweight</td>
<td>(float) Molecular weight in units of proton mass</td>
</tr>
<tr class="row-odd"><td>nlev</td>
<td>(int) Nr of energy levels</td>
</tr>
<tr class="row-even"><td>nlin</td>
<td>(int) Nr of lines</td>
</tr>
<tr class="row-odd"><td>energycminv</td>
<td>(float) Energy[ilev] of level ilev in 1/cm</td>
</tr>
<tr class="row-even"><td>energy</td>
<td>(float) Energy[ilev] of level ilev in erg</td>
</tr>
<tr class="row-odd"><td>wgt</td>
<td>(float) Statistical weight[ilev] of level ilev</td>
</tr>
<tr class="row-even"><td>jrot</td>
<td>(float) Quantum rotational J[ilev] of level ilev</td>
</tr>
<tr class="row-odd"><td>iup</td>
<td>(int) ilev of upper level of line ilin (starting with 0)</td>
</tr>
<tr class="row-even"><td>ilow</td>
<td>(int) ilev of lower level of line ilin (starting with 0)</td>
</tr>
<tr class="row-odd"><td>aud</td>
<td>(float) Einstein A up low of line ilin in 1/second</td>
</tr>
<tr class="row-even"><td>freq</td>
<td>(float) Frequency of line ilin in Hz</td>
</tr>
<tr class="row-odd"><td>lam</td>
<td>(float) Wavelength of line ilin in micron</td>
</tr>
<tr class="row-even"><td>temp</td>
<td>(ndarray) Temperature grid of the partition function</td>
</tr>
<tr class="row-odd"><td>pfunc</td>
<td>(ndarray) Partition function</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.molecule.radmc3dMolecule.getPartitionFunction" title="radmc3dPy.molecule.radmc3dMolecule.getPartitionFunction"><code class="xref py py-obj docutils literal"><span class="pre">getPartitionFunction</span></code></a>([temp,&nbsp;tmin,&nbsp;tmax,&nbsp;...])</td>
<td>Calculates the partition function at a grid of temperatures</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.molecule.radmc3dMolecule.read" title="radmc3dPy.molecule.radmc3dMolecule.read"><code class="xref py py-obj docutils literal"><span class="pre">read</span></code></a>([mol,&nbsp;fname])</td>
<td>Read the molecule_&lt;mol&gt;.inp file</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.molecule.radmc3dMolecule.getPartitionFunction">
<code class="descname">getPartitionFunction</code><span class="sig-paren">(</span><em>temp=None</em>, <em>tmin=None</em>, <em>tmax=None</em>, <em>ntemp=None</em>, <em>tlog=True</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.molecule.radmc3dMolecule.getPartitionFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the partition function at a grid of temperatures</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>temp</strong> : list,ndarray</p>
<blockquote>
<div><p>Temperature(s) in Kelvin to calculate the partition function at</p>
</div></blockquote>
<p><strong>tmin</strong> : float, optional</p>
<blockquote>
<div><p>Minimum temperature in the grid (if temp is None)</p>
</div></blockquote>
<p><strong>tmax</strong> : float, optional</p>
<blockquote>
<div><p>Maximum temperature in the grid (if temp is None)</p>
</div></blockquote>
<p><strong>ntemp</strong> : int, optional</p>
<blockquote>
<div><p>Number of temperature in the grid (if temp is None)</p>
</div></blockquote>
<p><strong>tlog</strong> : bool</p>
<blockquote>
<div><p>If True the generated temperature grid will be logarithmic. If False the grid will be linear.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The temperature grid and partition function will be put in the temp and pfunc data attributes of the class</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.molecule.radmc3dMolecule.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>mol=None</em>, <em>fname=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.molecule.radmc3dMolecule.read" title="Permalink to this definition">¶</a></dt>
<dd><p>Read the molecule_&lt;mol&gt;.inp file</p>
<p>The file format is the format of the Leiden LAMDA molecular database</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>mol</strong> : str</p>
<blockquote>
<div><p>molecule name (e.g. &#8216;co&#8217;) if the file name is in the form of &#8216;molecule_&lt;mol&gt;.inp&#8217;</p>
</div></blockquote>
<p><strong>fname</strong> : str</p>
<blockquote class="last">
<div><p>full file name</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.natconst">
<span id="radmc3dpy-natconst-module"></span><h2>radmc3dPy.natconst module<a class="headerlink" href="#module-radmc3dPy.natconst" title="Permalink to this headline">¶</a></h2>
<p>This module contains natural constants in CGS units</p>
<p>Translated from RADMC&#8217;s IDL function problem_natconst.pro</p>
<p>List of natural constants:</p>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="91%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Name</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>gg</td>
<td>Gravitational constant</td>
</tr>
<tr class="row-odd"><td>mp</td>
<td>Mass of proton [g]</td>
</tr>
<tr class="row-even"><td>me</td>
<td>Mass of electron [g]</td>
</tr>
<tr class="row-odd"><td>kk</td>
<td>Bolzmann&#8217;s constant [erg/K]</td>
</tr>
<tr class="row-even"><td>hh</td>
<td>Planck&#8217;s constant [erg.s]</td>
</tr>
<tr class="row-odd"><td>ee</td>
<td>Unit charge</td>
</tr>
<tr class="row-even"><td>cc</td>
<td>Light speed [cm/s]</td>
</tr>
<tr class="row-odd"><td>st</td>
<td>Thmpson cross-section [cm^2]</td>
</tr>
<tr class="row-even"><td>ss</td>
<td>Stefan-Boltzmann const [erg/cm^2/K^4/s]</td>
</tr>
<tr class="row-odd"><td>aa</td>
<td>4 * ss / cc</td>
</tr>
<tr class="row-even"><td>muh2</td>
<td>Mean molecular weight (H2 + He + metals)</td>
</tr>
<tr class="row-odd"><td>ev</td>
<td>Electronvolt [erg]</td>
</tr>
<tr class="row-even"><td>kev</td>
<td>Kilo electronvolt [erg]</td>
</tr>
<tr class="row-odd"><td>micr</td>
<td>Micron [cm]</td>
</tr>
<tr class="row-even"><td>km</td>
<td>Kilometer [cm]</td>
</tr>
<tr class="row-odd"><td>angs</td>
<td>Angstrom [cm]</td>
</tr>
<tr class="row-even"><td>ls</td>
<td>Solar luminosity [erg/s]</td>
</tr>
<tr class="row-odd"><td>rs</td>
<td>Solar radius [cm]</td>
</tr>
<tr class="row-even"><td>ms</td>
<td>Solar mass [g]</td>
</tr>
<tr class="row-odd"><td>ts</td>
<td>Solar effective temperature [K]</td>
</tr>
<tr class="row-even"><td>au</td>
<td>Astronomical unit [cm]</td>
</tr>
<tr class="row-odd"><td>pc</td>
<td>Parsec [cm]</td>
</tr>
<tr class="row-even"><td>mea</td>
<td>Mass of Earth [g]</td>
</tr>
<tr class="row-odd"><td>rea</td>
<td>Equatorila radius of Earth [cm]</td>
</tr>
<tr class="row-even"><td>mmo</td>
<td>Mass of Moon [g]</td>
</tr>
<tr class="row-odd"><td>rmo</td>
<td>Radius of Moon [cm]</td>
</tr>
<tr class="row-even"><td>dmo</td>
<td>Distance earth-moon (center-to-center) [cm]</td>
</tr>
<tr class="row-odd"><td>mju</td>
<td>Mass of Jupiter</td>
</tr>
<tr class="row-even"><td>rju</td>
<td>Equatorial radius of Jupiter [cm]</td>
</tr>
<tr class="row-odd"><td>dju</td>
<td>Distance Jupiter-Sun [cm]</td>
</tr>
<tr class="row-even"><td>year</td>
<td>Year [s]</td>
</tr>
<tr class="row-odd"><td>hour</td>
<td>Hour [s]</td>
</tr>
<tr class="row-even"><td>day</td>
<td>Day  [s]</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="module-radmc3dPy.octree">
<span id="radmc3dpy-octree-module"></span><h2>radmc3dPy.octree module<a class="headerlink" href="#module-radmc3dPy.octree" title="Permalink to this headline">¶</a></h2>
<p>This module contains a class for handling Octree mesh</p>
<dl class="class">
<dt id="radmc3dPy.octree.radmc3dOctree">
<em class="property">class </em><code class="descclassname">radmc3dPy.octree.</code><code class="descname">radmc3dOctree</code><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Octree-like object with switchable resolution in each dimension</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="91%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>xi</td>
<td>(ndarray) Base grid cell interface grid in the first dimension</td>
</tr>
<tr class="row-even"><td>yi</td>
<td>(ndarray) Base grid cell interface grid in the second dimension</td>
</tr>
<tr class="row-odd"><td>zi</td>
<td>(ndarray) Base grid cell interface grid in the third dimension</td>
</tr>
<tr class="row-even"><td>xc</td>
<td>(ndarray) Base grid cell center grid in the first dimension</td>
</tr>
<tr class="row-odd"><td>yc</td>
<td>(ndarray) Base grid cell center grid in the second dimension</td>
</tr>
<tr class="row-even"><td>zc</td>
<td>(ndarray) Base grid cell center grid in the third dimension</td>
</tr>
<tr class="row-odd"><td>x</td>
<td>(ndarray) Tree cell center array in the first dimension</td>
</tr>
<tr class="row-even"><td>y</td>
<td>(ndarray) Tree cell center array in the second dimension</td>
</tr>
<tr class="row-odd"><td>z</td>
<td>(ndarray) Tree cell center array in the third dimension</td>
</tr>
<tr class="row-even"><td>dx</td>
<td>(ndarray) Tree cell halfwidth array in the first dimension</td>
</tr>
<tr class="row-odd"><td>dy</td>
<td>(ndarray) Tree cell halfwidth array in the second dimension</td>
</tr>
<tr class="row-even"><td>dz</td>
<td>(ndarray) Tree cell halfwidth array in the third dimension</td>
</tr>
<tr class="row-odd"><td>leafID</td>
<td>(ndarray) Leaf index array,  mapping between a full tree and an array containing only the leaves</td>
</tr>
<tr class="row-even"><td>isLeaf</td>
<td>(ndarray) Boolean array for the cell type (True - leaf, False - branch)</td>
</tr>
<tr class="row-odd"><td>level</td>
<td>(ndarray) Level array (base grid is level 0)</td>
</tr>
<tr class="row-even"><td>parentID</td>
<td>(ndarray) Array containing the index of the parent cell (currently unused, only needed if we go up in the tree)</td>
</tr>
<tr class="row-odd"><td>childID</td>
<td>(list) List of children indices. Each list element is an ndarray with nChild elements containing the child indices</td>
</tr>
<tr class="row-even"><td>act_dim</td>
<td>(list) A three element array to indicate which dimension is active, i.e. which dimensions are the cells resolved (0 - inactive, 1 - active)</td>
</tr>
<tr class="row-odd"><td>nCell</td>
<td>(int) Nr of cells (both branch and leaf) in the tree</td>
</tr>
<tr class="row-even"><td>nxRoot</td>
<td>(int) Nr of cells in the base grid in the first dimension</td>
</tr>
<tr class="row-odd"><td>nyRoot</td>
<td>(int) Nr of cells in the base grid in the second dimension</td>
</tr>
<tr class="row-even"><td>nzRoot</td>
<td>(int) Nr of cells in the base grid in the third dimension</td>
</tr>
<tr class="row-odd"><td>nLeaf</td>
<td>(int) Nr of leaf cells (i.e. true, unresolved grid cells)</td>
</tr>
<tr class="row-even"><td>nBranch</td>
<td>(int) Nr of branches (i.e. resolved cells)</td>
</tr>
<tr class="row-odd"><td>nChild</td>
<td>(int) Nr of children (i.e. 8, 4, or 2 for 3, 2, 1 active dimensions, respectively)</td>
</tr>
<tr class="row-even"><td>levelMax</td>
<td>(int) Highest actual level in the tree (Base grid has a level of 0 and the level increases)</td>
</tr>
<tr class="row-odd"><td>levelMaxLimit</td>
<td>(int) Highest allowed level in the tree (only used in tree building)</td>
</tr>
<tr class="row-even"><td>crd_sys</td>
<td>({&#8216;car&#8217;, &#8216;sph&#8217;}) Coordinate system type cartesian or spherical</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.convArrLeaf2Tree" title="radmc3dPy.octree.radmc3dOctree.convArrLeaf2Tree"><code class="xref py py-obj docutils literal"><span class="pre">convArrLeaf2Tree</span></code></a>([var])</td>
<td>Converts a leaf array to full tree size.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.convArrTree2Leaf" title="radmc3dPy.octree.radmc3dOctree.convArrTree2Leaf"><code class="xref py py-obj docutils literal"><span class="pre">convArrTree2Leaf</span></code></a>([var])</td>
<td>Converts a data array to leaf size.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.generateLeafID" title="radmc3dPy.octree.radmc3dOctree.generateLeafID"><code class="xref py py-obj docutils literal"><span class="pre">generateLeafID</span></code></a>()</td>
<td>Function to generate the cell index mapping from arrays containing the full tree and those containing</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.getCellVolume" title="radmc3dPy.octree.radmc3dOctree.getCellVolume"><code class="xref py py-obj docutils literal"><span class="pre">getCellVolume</span></code></a>([fullTree])</td>
<td>Calculates the grid cell volume</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.getContainerLeafID" title="radmc3dPy.octree.radmc3dOctree.getContainerLeafID"><code class="xref py py-obj docutils literal"><span class="pre">getContainerLeafID</span></code></a>([crd])</td>
<td>Finds the tree index of a leaf that contains a given coordinate</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.makeSpatialGrid" title="radmc3dPy.octree.radmc3dOctree.makeSpatialGrid"><code class="xref py py-obj docutils literal"><span class="pre">makeSpatialGrid</span></code></a>([ppar,&nbsp;levelMaxLimit,&nbsp;...])</td>
<td>Function to create an octree-like AMR grid</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.makeWavelengthGrid" title="radmc3dPy.octree.radmc3dOctree.makeWavelengthGrid"><code class="xref py py-obj docutils literal"><span class="pre">makeWavelengthGrid</span></code></a>([wbound,&nbsp;nw,&nbsp;ppar])</td>
<td>Creates the wavelength/frequency grid.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.putNode" title="radmc3dPy.octree.radmc3dOctree.putNode"><code class="xref py py-obj docutils literal"><span class="pre">putNode</span></code></a>([crd,&nbsp;cellsize,&nbsp;level,&nbsp;parentID,&nbsp;cellID])</td>
<td>Function to put the data of a single node into the tree.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.readGrid" title="radmc3dPy.octree.radmc3dOctree.readGrid"><code class="xref py py-obj docutils literal"><span class="pre">readGrid</span></code></a>()</td>
<td>Reads the spatial and wavelength grids from files</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.readSpatialGrid" title="radmc3dPy.octree.radmc3dOctree.readSpatialGrid"><code class="xref py py-obj docutils literal"><span class="pre">readSpatialGrid</span></code></a>([fname])</td>
<td>Reads the spatial grid from amr_grid.inp</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.readWavelengthGrid" title="radmc3dPy.octree.radmc3dOctree.readWavelengthGrid"><code class="xref py py-obj docutils literal"><span class="pre">readWavelengthGrid</span></code></a>([fname])</td>
<td>Function to read the wavelength/frequency grid</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.resolveNodes" title="radmc3dPy.octree.radmc3dOctree.resolveNodes"><code class="xref py py-obj docutils literal"><span class="pre">resolveNodes</span></code></a>([rsIDs])</td>
<td>Resolve multiple nodes simultaneously and add the children of the resolved node to the tree arrays extending</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.selfCheck" title="radmc3dPy.octree.radmc3dOctree.selfCheck"><code class="xref py py-obj docutils literal"><span class="pre">selfCheck</span></code></a>()</td>
<td>Performs a self-check of the tree allocation and report it to the screen</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.setModel" title="radmc3dPy.octree.radmc3dOctree.setModel"><code class="xref py py-obj docutils literal"><span class="pre">setModel</span></code></a>([model])</td>
<td>Sets the model to be used for tree building</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.writeSpatialGrid" title="radmc3dPy.octree.radmc3dOctree.writeSpatialGrid"><code class="xref py py-obj docutils literal"><span class="pre">writeSpatialGrid</span></code></a>([fname])</td>
<td>Writes the wavelength grid to a file (e.g.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.octree.radmc3dOctree.writeWavelengthGrid" title="radmc3dPy.octree.radmc3dOctree.writeWavelengthGrid"><code class="xref py py-obj docutils literal"><span class="pre">writeWavelengthGrid</span></code></a>([fname,&nbsp;old])</td>
<td>Wriites the wavelength grid to a file (e.g.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.convArrLeaf2Tree">
<code class="descname">convArrLeaf2Tree</code><span class="sig-paren">(</span><em>var=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.convArrLeaf2Tree" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a leaf array to full tree size.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>var</strong> : ndarray</p>
<blockquote>
<div><p>A one or two dimensional ndarray with the first dimension is the size of the full tree</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A one or two dimensional ndarray with size of of the full tree in the first dimension</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.convArrTree2Leaf">
<code class="descname">convArrTree2Leaf</code><span class="sig-paren">(</span><em>var=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.convArrTree2Leaf" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a data array to leaf size. The input is a scalar or vector variable defined at all nodes and the
returned variable will only represent values at leaf nodes thereby reduced in length compared to the input.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>var</strong> : ndarray</p>
<blockquote>
<div><p>A one or two dimensional ndarray with the first dimension is the size of the full tree</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A one or two dimensional ndarray with size of nLeaf in the first dimension</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.generateLeafID">
<code class="descname">generateLeafID</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.generateLeafID" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to generate the cell index mapping from arrays containing the full tree and those containing
only the leaves</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.getCellVolume">
<code class="descname">getCellVolume</code><span class="sig-paren">(</span><em>fullTree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.getCellVolume" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the grid cell volume</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fullTree</strong> : bool, optional</p>
<blockquote>
<div><p>If True the cell volumes of the full tree (including both branches and leaves) will be
calculated, while if set to False (default) the volume of only the leaf cells will be calculated</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An linear ndarray containing the cell volumes</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.getContainerLeafID">
<code class="descname">getContainerLeafID</code><span class="sig-paren">(</span><em>crd=()</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.getContainerLeafID" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds the tree index of a leaf that contains a given coordinate</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd</strong> : tuple</p>
<blockquote class="last">
<div><p>List/tuple/ndarray containing the tree dimensional coordinates of the point</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.makeSpatialGrid">
<code class="descname">makeSpatialGrid</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>levelMaxLimit=None</em>, <em>dfunc=None</em>, <em>model=''</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.makeSpatialGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to create an octree-like AMR grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all input parameters of the model (from the problem_params.inp file)</p>
</div></blockquote>
<p><strong>model</strong> : str</p>
<blockquote>
<div><p>Name of the model to be used in the tree building</p>
</div></blockquote>
<p><strong>dfunc</strong> : function</p>
<blockquote>
<div><p>A user defined function that decides whether an AMR grid cell should be refined</p>
</div></blockquote>
<p><strong>levelMaxLimit</strong> : int, optional</p>
<blockquote class="last">
<div><p>Highest allowable level of the tree. This keyword is optional. If not specified at input as
a separate keyword, levelMaxLimit should be present in the problem_params.inp file.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.makeWavelengthGrid">
<code class="descname">makeWavelengthGrid</code><span class="sig-paren">(</span><em>wbound=None</em>, <em>nw=None</em>, <em>ppar=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.makeWavelengthGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates the wavelength/frequency grid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>wbound</strong> : list</p>
<blockquote>
<div><p>Contains the wavelength boundaries of the wavelength grid (should contain at least two elements)</p>
</div></blockquote>
<p><strong>nw</strong> : list</p>
<blockquote>
<div><p>Contains len(wbound)-1 elements containing the number of wavelengths between the bounds
set by wbound</p>
</div></blockquote>
<p><strong>ppar</strong> : dictionary, optional</p>
<blockquote class="last">
<div><p>Contains all input parameters with the parameter names as keys</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.putNode">
<code class="descname">putNode</code><span class="sig-paren">(</span><em>crd=()</em>, <em>cellsize=()</em>, <em>level=None</em>, <em>parentID=-1</em>, <em>cellID=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.putNode" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to put the data of a single node into the tree. This funcion assumes that all the arrays
have already been allocated for the tree so input cell indices must refer to already existing array elements.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd</strong> : tuple</p>
<blockquote>
<div><p>Cell center coordinates of the node</p>
</div></blockquote>
<p><strong>cellsize</strong> : tuple</p>
<blockquote>
<div><p>Full size of the cell in each dimension</p>
</div></blockquote>
<p><strong>level</strong> : int</p>
<blockquote>
<div><p>Level of the cell in the tree</p>
</div></blockquote>
<p><strong>parentID</strong> : int</p>
<blockquote>
<div><p>Tree index of the parent cell</p>
</div></blockquote>
<p><strong>cellID</strong> : int</p>
<blockquote class="last">
<div><p>Tree index of the cell to be added</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.readGrid">
<code class="descname">readGrid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.readGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the spatial and wavelength grids from files</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.readSpatialGrid">
<code class="descname">readSpatialGrid</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.readSpatialGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the spatial grid from amr_grid.inp</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>File name from which the spatial grid should be read. If omitted &#8216;amr_grid.inp&#8217; will be used.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.readWavelengthGrid">
<code class="descname">readWavelengthGrid</code><span class="sig-paren">(</span><em>fname='wavelength_micron.inp'</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.readWavelengthGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to read the wavelength/frequency grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>Name of the file to read the wavelength grid from (if not specified wavelenth_micron.inp will
be used)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.resolveNodes">
<code class="descname">resolveNodes</code><span class="sig-paren">(</span><em>rsIDs=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.resolveNodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Resolve multiple nodes simultaneously and add the children of the resolved node to the tree arrays extending
the tree array</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>rsIDs</strong> : list</p>
<blockquote class="last">
<div><p>List/tuple/array of indices of the resolvable cell in the tree array</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.selfCheck">
<code class="descname">selfCheck</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.selfCheck" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs a self-check of the tree allocation and report it to the screen</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.setModel">
<code class="descname">setModel</code><span class="sig-paren">(</span><em>model=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.setModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the model to be used for tree building</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote class="last">
<div><p>Name of the model</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.writeSpatialGrid">
<code class="descname">writeSpatialGrid</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.writeSpatialGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the wavelength grid to a file (e.g. amr_grid.inp).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>File name into which the spatial grid should be written. If omitted &#8216;amr_grid.inp&#8217; will be used.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.octree.radmc3dOctree.writeWavelengthGrid">
<code class="descname">writeWavelengthGrid</code><span class="sig-paren">(</span><em>fname=''</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.octree.radmc3dOctree.writeWavelengthGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Wriites the wavelength grid to a file (e.g. wavelength_micron.inp).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name into which the wavelength grid should be written. If omitted &#8216;wavelength_micron.inp&#8217; will
be used</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.params">
<span id="radmc3dpy-params-module"></span><h2>radmc3dPy.params module<a class="headerlink" href="#module-radmc3dPy.params" title="Permalink to this headline">¶</a></h2>
<p>This module contains classes for handling of parameters of the model setup and for file I/O</p>
<dl class="class">
<dt id="radmc3dPy.params.radmc3dPar">
<em class="property">class </em><code class="descclassname">radmc3dPy.params.</code><code class="descname">radmc3dPar</code><a class="headerlink" href="#radmc3dPy.params.radmc3dPar" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Parameter class for a RADMC-3D model.</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="85%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>ppar</td>
<td>(dictionary) Contains parameter values with parameter names as keys</td>
</tr>
<tr class="row-even"><td>pdesc</td>
<td>(dictionary) Contains parameter description (comments in the parameter file) with parameter names as keys</td>
</tr>
<tr class="row-odd"><td>pblock</td>
<td>(dictionary) Contains the block names in the parameter file and parameter names as values</td>
</tr>
<tr class="row-even"><td>pvalstr: dictionary</td>
<td>Contains parameter values as strings with parameter names as keys</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.params.radmc3dPar.loadDefaults" title="radmc3dPy.params.radmc3dPar.loadDefaults"><code class="xref py py-obj docutils literal"><span class="pre">loadDefaults</span></code></a>([model,&nbsp;ppar,&nbsp;reset])</td>
<td>Sets all parameters to default values.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.params.radmc3dPar.printPar" title="radmc3dPy.params.radmc3dPar.printPar"><code class="xref py py-obj docutils literal"><span class="pre">printPar</span></code></a>()</td>
<td>Prints the parameters of the current model.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.params.radmc3dPar.readPar" title="radmc3dPy.params.radmc3dPar.readPar"><code class="xref py py-obj docutils literal"><span class="pre">readPar</span></code></a>([fname])</td>
<td>Reads a parameter file.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.params.radmc3dPar.setPar" title="radmc3dPy.params.radmc3dPar.setPar"><code class="xref py py-obj docutils literal"><span class="pre">setPar</span></code></a>([parlist])</td>
<td>Sets a parameter in the radmc3DPar class.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.params.radmc3dPar.writeParfile" title="radmc3dPy.params.radmc3dPar.writeParfile"><code class="xref py py-obj docutils literal"><span class="pre">writeParfile</span></code></a>([fname])</td>
<td>Writes a parameter file.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.params.radmc3dPar.loadDefaults">
<code class="descname">loadDefaults</code><span class="sig-paren">(</span><em>model=''</em>, <em>ppar=None</em>, <em>reset=True</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.params.radmc3dPar.loadDefaults" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets all parameters to default values.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote>
<div><p>Model name whose paraemters should also be loaded</p>
</div></blockquote>
<p><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Contains parameter values as string and parameter names as keys
Default values will be re-set to the values in this dictionary</p>
</div></blockquote>
<p><strong>reset</strong> : bool</p>
<blockquote class="last">
<div><p>If True the all class attributes will be re-initialized before
the default values would be loaded. I.e. it will remove all entries
from the dictionary that does not conain default values either in this
function or in the optional ppar keyword argument</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.params.radmc3dPar.printPar">
<code class="descname">printPar</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.params.radmc3dPar.printPar" title="Permalink to this definition">¶</a></dt>
<dd><p>Prints the parameters of the current model.</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.params.radmc3dPar.readPar">
<code class="descname">readPar</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.params.radmc3dPar.readPar" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads a parameter file.
The parameters in the files should follow python syntax</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name to be read (if omitted problem_params.inp is used)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns a dictionary with the parameter names as keys</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.params.radmc3dPar.setPar">
<code class="descname">setPar</code><span class="sig-paren">(</span><em>parlist=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.params.radmc3dPar.setPar" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets a parameter in the radmc3DPar class.
If the paramter is already defined its value will be modified</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>parlist</strong> : list</p>
<blockquote class="last">
<div><p>If the parameter is already defined parlist should be a two element
list 1) parameter name, 2) parameter expression/value as a string</p>
<p>If the parameter is not yet defined parlist should be a four element
list 1) parameter name, 2) parameter expression/value as a string
3) Parameter description (= comment field in the parameter file)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.params.radmc3dPar.writeParfile">
<code class="descname">writeParfile</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.params.radmc3dPar.writeParfile" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes a parameter file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>File name to be read (if omitted problem_params.inp is used)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.radsources">
<span id="radmc3dpy-radsources-module"></span><h2>radmc3dPy.radsources module<a class="headerlink" href="#module-radmc3dPy.radsources" title="Permalink to this headline">¶</a></h2>
<p>This module contains classes for radiation sources</p>
<dl class="class">
<dt id="radmc3dPy.radsources.radmc3dRadSources">
<em class="property">class </em><code class="descclassname">radmc3dPy.radsources.</code><code class="descname">radmc3dRadSources</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class of the radiation sources.
Currently discrete stars and continuous starlike source, the latter only in spherical coordinates.</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>wav</td>
<td>(ndarray) Wavelength for the stellar spectrum</td>
</tr>
<tr class="row-even"><td>freq</td>
<td>(ndarray) Frequency for the stellar spectrum</td>
</tr>
<tr class="row-odd"><td>nwav</td>
<td>(int) Number of wavelenghts in the stellar spectrum</td>
</tr>
<tr class="row-even"><td>nfreq</td>
<td>(int) Number of frequencies in the stellar spectrum</td>
</tr>
<tr class="row-odd"><td>mstar</td>
<td>(list) List of stellar masses</td>
</tr>
<tr class="row-even"><td>tstar</td>
<td>(list) List of stellar effective temperatures</td>
</tr>
<tr class="row-odd"><td>rstar</td>
<td>(list) List of stellar radii</td>
</tr>
<tr class="row-even"><td>lstar</td>
<td>(list) List of stellar luminosities</td>
</tr>
<tr class="row-odd"><td>nstar</td>
<td>(int) Number of stars</td>
</tr>
<tr class="row-even"><td>pstar</td>
<td>(list) Each element of the list contains a three element list, the cartesian coordinates of the stars</td>
</tr>
<tr class="row-odd"><td>fnustar</td>
<td>(ndarray) Stellar spectrum (<a class="reference external" href="mailto:flux&#37;&#52;&#48;1pc">flux<span>&#64;</span>1pc</a> in erg/s/cm/cm/Hz)</td>
</tr>
<tr class="row-even"><td>csdens</td>
<td>(ndarray) Stellar density for continuous starlike source</td>
</tr>
<tr class="row-odd"><td>csntemplate</td>
<td>(int) Number of stellar templates</td>
</tr>
<tr class="row-even"><td>cstemp</td>
<td>(ndarray) Stellar template</td>
</tr>
<tr class="row-odd"><td>cstemptype</td>
<td>(int) Stellar template type 1 - Blackbody given by the effective temperature 2 - Frequency dependent spectrum</td>
</tr>
<tr class="row-even"><td>cststar</td>
<td>(ndarray) Stellar effective temperature</td>
</tr>
<tr class="row-odd"><td>csmstar</td>
<td>(ndarray) Stellar mass</td>
</tr>
<tr class="row-even"><td>csrstar</td>
<td>(ndarray) Stellar radius</td>
</tr>
<tr class="row-odd"><td>tacc</td>
<td>(ndarray) Effective temperature of a viscous accretion disk as a function of cylindrical radius</td>
</tr>
<tr class="row-even"><td>accrate</td>
<td>(float) Accretion rate of the viscous accretion disk [g/s]</td>
</tr>
<tr class="row-odd"><td>fnuaccdisk</td>
<td>(ndarray) Spatially integrated frequency-dependent flux density of the accretion disk &#64; 1pc distance</td>
</tr>
<tr class="row-even"><td>tspot</td>
<td>(float) Temperature of the hot spot / boundary layer on the stellar surface</td>
</tr>
<tr class="row-odd"><td>starsurffrac</td>
<td>(float) Fraction of the stellar surface covered by the hot spot / boundary layer</td>
</tr>
<tr class="row-even"><td>fnustpot</td>
<td>(ndarray) Frequency-dependent flux density of the hot spot / boundary layer &#64; 1pc distance</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.findPeakStarspec" title="radmc3dPy.radsources.radmc3dRadSources.findPeakStarspec"><code class="xref py py-obj docutils literal"><span class="pre">findPeakStarspec</span></code></a>()</td>
<td>Calculates the peak wavelength of the stellar spectrum.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskSpectra" title="radmc3dPy.radsources.radmc3dRadSources.getAccdiskSpectra"><code class="xref py py-obj docutils literal"><span class="pre">getAccdiskSpectra</span></code></a>([ppar,&nbsp;grid,&nbsp;incl])</td>
<td>Calculates the emergent spectra of an optically thick accretion disk at face-on orientation (incl=0deg).</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarDensity" title="radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarDensity"><code class="xref py py-obj docutils literal"><span class="pre">getAccdiskStellarDensity</span></code></a>([grid])</td>
<td>Calculates the stellar density for continuous starlike sources for modeling a viscous accretion disk.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarTemplates" title="radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarTemplates"><code class="xref py py-obj docutils literal"><span class="pre">getAccdiskStellarTemplates</span></code></a>([ppar,&nbsp;grid])</td>
<td>Calculates the stellar template for continuous starlike sources for modeling a viscous accretion disk.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskTemperature" title="radmc3dPy.radsources.radmc3dRadSources.getAccdiskTemperature"><code class="xref py py-obj docutils literal"><span class="pre">getAccdiskTemperature</span></code></a>([ppar,&nbsp;grid])</td>
<td>Calculates the effective temperature of a viscous accretion disk.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getSpotSpectrum" title="radmc3dPy.radsources.radmc3dRadSources.getSpotSpectrum"><code class="xref py py-obj docutils literal"><span class="pre">getSpotSpectrum</span></code></a>([ppar,&nbsp;grid])</td>
<td>Calculates the spectrum of a hot spot / boundary layer on the stellar surface</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getStarSpectrum" title="radmc3dPy.radsources.radmc3dRadSources.getStarSpectrum"><code class="xref py py-obj docutils literal"><span class="pre">getStarSpectrum</span></code></a>([tstar,&nbsp;rstar,&nbsp;lstar,&nbsp;...])</td>
<td>Calculates a blackbody stellar spectrum.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.getTotalLuminosities" title="radmc3dPy.radsources.radmc3dRadSources.getTotalLuminosities"><code class="xref py py-obj docutils literal"><span class="pre">getTotalLuminosities</span></code></a>([readInput])</td>
<td>Calcultes the frequency integrated luminosities of all radiation sources.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.readStarsinp" title="radmc3dPy.radsources.radmc3dRadSources.readStarsinp"><code class="xref py py-obj docutils literal"><span class="pre">readStarsinp</span></code></a>([fname])</td>
<td>Reads the data of discrete stellar sources from the stars.inp file.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.readStellarsrcDensity" title="radmc3dPy.radsources.radmc3dRadSources.readStellarsrcDensity"><code class="xref py py-obj docutils literal"><span class="pre">readStellarsrcDensity</span></code></a>([fname,&nbsp;binary])</td>
<td>Reads the stellar density of a continuous starlike source.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.readStellarsrcTemplates" title="radmc3dPy.radsources.radmc3dRadSources.readStellarsrcTemplates"><code class="xref py py-obj docutils literal"><span class="pre">readStellarsrcTemplates</span></code></a>([fname])</td>
<td>Reads the stellar template of a continuous starlike source.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.writeStarsinp" title="radmc3dPy.radsources.radmc3dRadSources.writeStarsinp"><code class="xref py py-obj docutils literal"><span class="pre">writeStarsinp</span></code></a>([ppar,&nbsp;wav,&nbsp;freq,&nbsp;old])</td>
<td>Writes the input file for discrete stellar sources (stars.inp).</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcDensity" title="radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcDensity"><code class="xref py py-obj docutils literal"><span class="pre">writeStellarsrcDensity</span></code></a>([fname,&nbsp;binary])</td>
<td>Writes the stellar density of a continuous starlike source.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcTemplates" title="radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcTemplates"><code class="xref py py-obj docutils literal"><span class="pre">writeStellarsrcTemplates</span></code></a>([fname])</td>
<td>Writes the stellar template of a continuous starlike source.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.findPeakStarspec">
<code class="descname">findPeakStarspec</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.findPeakStarspec" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the peak wavelength of the stellar spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The peak wavelength of the stellar spectrum in nu*Fnu for all</p>
<blockquote class="last">
<div><p>stars as a list</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getAccdiskSpectra">
<code class="descname">getAccdiskSpectra</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>grid=None</em>, <em>incl=0.0</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskSpectra" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the emergent spectra of an optically thick accretion disk at face-on orientation (incl=0deg).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all input parameters keys should include
* mstar   : stellar mass
* rstar   : stellar radius
* accrate : accretion rate</p>
<p>NOTE, that for the calculation of the effective disk temperature only the first
star is used if more than one values are given in mstar and rstar.</p>
</div></blockquote>
<p><strong>incl</strong> : float, optional</p>
<blockquote>
<div><p>Inclination angle in degrees at which the spectrum be calculated  (default - 0deg)</p>
</div></blockquote>
<p><strong>grid</strong> : radmc3dGrid, optional</p>
<blockquote class="last">
<div><p>An instance of a radmc3dGrid class containing the spatial and wavelength grid</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarDensity">
<code class="descname">getAccdiskStellarDensity</code><span class="sig-paren">(</span><em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarDensity" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the stellar density for continuous starlike sources for modeling a viscous accretion disk.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>grid</strong> : radmc3dGrid, optional</p>
<blockquote class="last">
<div><p>An instance of a radmc3dGrid class containing the spatial and wavelength grid</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarTemplates">
<code class="descname">getAccdiskStellarTemplates</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskStellarTemplates" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the stellar template for continuous starlike sources for modeling a viscous accretion disk.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all input parameters keys should include:
* mstar   : stellar mass
* rstar   : stellar radius
* accrate : accretion rate</p>
<p>NOTE, that for the calculation of the effective disk temperature only the first
star is used if more than one values are given in mstar and rstar.</p>
</div></blockquote>
<p><strong>grid</strong> : radmc3dGrid, optional</p>
<blockquote class="last">
<div><p>An instance of a radmc3dGrid class containing the spatial and wavelength grid</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getAccdiskTemperature">
<code class="descname">getAccdiskTemperature</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getAccdiskTemperature" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the effective temperature of a viscous accretion disk.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all input parameters keys should include
* mstar   : stellar mass
* rstar   : stellar radius
* accrate : accretion rate</p>
<p>NOTE, that for the calculation of the effective disk temperature only the first
star is used if more than one values are given in mstar and rstar.</p>
</div></blockquote>
<p><strong>grid</strong> : radmc3dGrid, optional</p>
<blockquote class="last">
<div><p>An instance of a radmc3dGrid class containing the spatial and wavelength grid</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getSpotSpectrum">
<code class="descname">getSpotSpectrum</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getSpotSpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the spectrum of a hot spot / boundary layer on the stellar surface</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all input parameters keys should include
* mstar   : stellar mass
* rstar   : stellar radius
* accrate : accretion rate</p>
<p>NOTE, that for the calculation of the effective disk temperature only the first
star is used if more than one values are given in mstar and rstar.</p>
</div></blockquote>
<p><strong>grid</strong> : radmc3dGrid, optional</p>
<blockquote class="last">
<div><p>An instance of a radmc3dGrid class containing the spatial and wavelength grid</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getStarSpectrum">
<code class="descname">getStarSpectrum</code><span class="sig-paren">(</span><em>tstar=None</em>, <em>rstar=None</em>, <em>lstar=None</em>, <em>mstar=None</em>, <em>ppar=None</em>, <em>grid=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getStarSpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates a blackbody stellar spectrum.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>tstar</strong> : list</p>
<blockquote>
<div><p>Effective temperature of the stars in [K]</p>
</div></blockquote>
<p><strong>rstar</strong> : list</p>
<blockquote>
<div><p>Radius of the stars in [cm]</p>
</div></blockquote>
<p><strong>lstar</strong> : list</p>
<blockquote>
<div><p>Bolometric luminosity of the star [erg/s] (either rstar or lstar should be given)</p>
</div></blockquote>
<p><strong>mstar</strong> : list</p>
<blockquote>
<div><p>Stellar mass in [g] (only required if an atmosphere model is used to calculate logg)</p>
</div></blockquote>
<p><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all input parameters</p>
</div></blockquote>
<p><strong>grid</strong> : radmc3dGrid, optional</p>
<blockquote class="last">
<div><p>An instance of a radmc3dGrid class containing the spatial and wavelength grid</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.getTotalLuminosities">
<code class="descname">getTotalLuminosities</code><span class="sig-paren">(</span><em>readInput=True</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.getTotalLuminosities" title="Permalink to this definition">¶</a></dt>
<dd><p>Calcultes the frequency integrated luminosities of all radiation sources.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>readInput</strong> : bool, optional</p>
<blockquote>
<div><p>If true the input files of the radiation sources are read and the the total luminosities
are calculated from them. If readInput is set to False, the luminosities are calculated
by semi-analytic spectra.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys</p>
<blockquote class="last">
<div><ul class="simple">
<li>lnu_star    : Luminosity of the discrete stars</li>
<li>lnu_accdisk : Luminosity of the accretion disk</li>
<li>lnu_spot    : Luminosity of the hot spot / boundary layer on the stellar surface</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.readStarsinp">
<code class="descname">readStarsinp</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.readStarsinp" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the data of discrete stellar sources from the stars.inp file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>File name of the file that should be read (if omitted stars.inp will be used)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.readStellarsrcDensity">
<code class="descname">readStellarsrcDensity</code><span class="sig-paren">(</span><em>fname=None</em>, <em>binary=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.readStellarsrcDensity" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the stellar density of a continuous starlike source.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file from which the stellar templates will be read. If omitted the default
&#8216;stellarsrc_templates.inp&#8217; will be used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If True the file should contain a C-style binary stream, if False the file should be
written as formatted ASCII</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.readStellarsrcTemplates">
<code class="descname">readStellarsrcTemplates</code><span class="sig-paren">(</span><em>fname='stellarsrc_templates.inp'</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.readStellarsrcTemplates" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the stellar template of a continuous starlike source.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>Name of the file from which the stellar templates will be read. If omitted the default
&#8216;stellarsrc_templates.inp&#8217; will be used.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.writeStarsinp">
<code class="descname">writeStarsinp</code><span class="sig-paren">(</span><em>ppar=None</em>, <em>wav=None</em>, <em>freq=None</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.writeStarsinp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the input file for discrete stellar sources (stars.inp).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary</p>
<blockquote>
<div><p>Dictionary containing all parameters of the model (only mandatory if accretion is switched on)</p>
</div></blockquote>
<p><strong>wav</strong> : ndarray, optional</p>
<blockquote>
<div><p>Wavelength grid for the stellar spectrum</p>
</div></blockquote>
<p><strong>freq</strong> : ndarray, optional</p>
<blockquote>
<div><p>Frequency grid for the stellar spectrum (either freq or wav should be set)</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcDensity">
<code class="descname">writeStellarsrcDensity</code><span class="sig-paren">(</span><em>fname=''</em>, <em>binary=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcDensity" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the stellar density of a continuous starlike source.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>Name of the file into which the stellar templates will be written. If omitted the default
&#8216;stellarsrc_templates.inp&#8217; will be used.</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If True the output will be written in a C-style binary stream, if False the output will be
formatted ASCII</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcTemplates">
<code class="descname">writeStellarsrcTemplates</code><span class="sig-paren">(</span><em>fname='stellarsrc_templates.inp'</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.radsources.radmc3dRadSources.writeStellarsrcTemplates" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the stellar template of a continuous starlike source.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote class="last">
<div><p>Name of the file into which the stellar templates will be written. If omitted the default
&#8216;stellarsrc_templates.inp&#8217; will be used.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.reggrid">
<span id="radmc3dpy-reggrid-module"></span><h2>radmc3dPy.reggrid module<a class="headerlink" href="#module-radmc3dPy.reggrid" title="Permalink to this headline">¶</a></h2>
<p>This module contains a class for handling regular wavelength and spatial grids</p>
<dl class="class">
<dt id="radmc3dPy.reggrid.radmc3dGrid">
<em class="property">class </em><code class="descclassname">radmc3dPy.reggrid.</code><code class="descname">radmc3dGrid</code><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class for spatial and frequency grid used by RADMC-3D.</p>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="5%" />
<col width="95%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>act_dim</td>
<td>(ndarray) A three element vector the i-th element is 1 if the i-th dimension is active, otherwize the i-th element is zero</td>
</tr>
<tr class="row-even"><td>crd_sys</td>
<td>({&#8216;sph&#8217;, &#8216;cyl&#8217;, &#8216;car&#8217;}) coordinate system of the spatial grid</td>
</tr>
<tr class="row-odd"><td>nx</td>
<td>(int) Number of grid points in the x (cartesian) / r (cylindrical) / r (spherical) dimension</td>
</tr>
<tr class="row-even"><td>ny</td>
<td>(int) Number of grid points in the y (cartesian) / theta (cylindrical) / theta (spherical) dimension</td>
</tr>
<tr class="row-odd"><td>nz</td>
<td>(int) Number of grid points in the z (cartesian) / z (cylindrical) / phi (spherical) dimension</td>
</tr>
<tr class="row-even"><td>nxi</td>
<td>(int) Number of cell interfaces in the x (cartesian) / r (cylindrical) / r (spherical) dimension</td>
</tr>
<tr class="row-odd"><td>nyi</td>
<td>(int) Number of cell interfaces in the y (cartesian) / theta (cylindrical) / theta (spherical) dimension</td>
</tr>
<tr class="row-even"><td>nzi</td>
<td>(int) Number of cell interfaces in the z (cartesian) / z (cylindrical) / phi (spherical) dimension</td>
</tr>
<tr class="row-odd"><td>nwav</td>
<td>(int) Number of wavelengths in the wavelength grid</td>
</tr>
<tr class="row-even"><td>nfreq</td>
<td>(int) Number of frequencies in the grid (equal to nwav)</td>
</tr>
<tr class="row-odd"><td>x</td>
<td>(ndarray) Cell centered x (cartesian) / r (cylindrical) / r (spherical)  grid points</td>
</tr>
<tr class="row-even"><td>y</td>
<td>(ndarray) Cell centered y (cartesian) / theta (cylindrical) / theta (spherical)  grid points</td>
</tr>
<tr class="row-odd"><td>z</td>
<td>(ndarray) Cell centered z (cartesian) / z (cylindrical) / phi (spherical)  grid points</td>
</tr>
<tr class="row-even"><td>xi</td>
<td>(ndarray) Cell interfaces in the x (cartesian) / r (cylindrical) / r (spherical)  dimension</td>
</tr>
<tr class="row-odd"><td>yi</td>
<td>(ndarray) Cell interfaces in the y (cartesian) / theta (cylindrical) / theta (spherical)  dimension</td>
</tr>
<tr class="row-even"><td>zi</td>
<td>(ndarray) Cell interfaces in the z (cartesian) / z (cylindrical) / phi (spherical)  dimension</td>
</tr>
<tr class="row-odd"><td>wav</td>
<td>(ndarray) Wavelengh  grid</td>
</tr>
<tr class="row-even"><td>freq</td>
<td>(ndarray) Frequency  grid</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.getCellVolume" title="radmc3dPy.reggrid.radmc3dGrid.getCellVolume"><code class="xref py py-obj docutils literal"><span class="pre">getCellVolume</span></code></a>()</td>
<td>Calculates the volume of grid cells.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.makeSpatialGrid" title="radmc3dPy.reggrid.radmc3dGrid.makeSpatialGrid"><code class="xref py py-obj docutils literal"><span class="pre">makeSpatialGrid</span></code></a>([crd_sys,&nbsp;xbound,&nbsp;ybound,&nbsp;...])</td>
<td>Calculates the spatial grid.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.makeWavelengthGrid" title="radmc3dPy.reggrid.radmc3dGrid.makeWavelengthGrid"><code class="xref py py-obj docutils literal"><span class="pre">makeWavelengthGrid</span></code></a>([wbound,&nbsp;nw,&nbsp;ppar])</td>
<td>Creates the wavelength/frequency grid.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.readGrid" title="radmc3dPy.reggrid.radmc3dGrid.readGrid"><code class="xref py py-obj docutils literal"><span class="pre">readGrid</span></code></a>([old])</td>
<td>Reads the spatial (amr_grid.inp) and frequency grid (wavelength_micron.inp).</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.readSpatialGrid" title="radmc3dPy.reggrid.radmc3dGrid.readSpatialGrid"><code class="xref py py-obj docutils literal"><span class="pre">readSpatialGrid</span></code></a>([fname,&nbsp;old])</td>
<td>Reads the spatial grid</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.readWavelengthGrid" title="radmc3dPy.reggrid.radmc3dGrid.readWavelengthGrid"><code class="xref py py-obj docutils literal"><span class="pre">readWavelengthGrid</span></code></a>([fname,&nbsp;old])</td>
<td>Reads the wavelength grid</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.writeSpatialGrid" title="radmc3dPy.reggrid.radmc3dGrid.writeSpatialGrid"><code class="xref py py-obj docutils literal"><span class="pre">writeSpatialGrid</span></code></a>([fname,&nbsp;old])</td>
<td>Writes the wavelength grid to a file (e.g.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.reggrid.radmc3dGrid.writeWavelengthGrid" title="radmc3dPy.reggrid.radmc3dGrid.writeWavelengthGrid"><code class="xref py py-obj docutils literal"><span class="pre">writeWavelengthGrid</span></code></a>([fname,&nbsp;old])</td>
<td>Wriites the wavelength grid to a file (e.g.</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.getCellVolume">
<code class="descname">getCellVolume</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.getCellVolume" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the volume of grid cells.</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.makeSpatialGrid">
<code class="descname">makeSpatialGrid</code><span class="sig-paren">(</span><em>crd_sys=None</em>, <em>xbound=None</em>, <em>ybound=None</em>, <em>zbound=None</em>, <em>nxi=None</em>, <em>nyi=None</em>, <em>nzi=None</em>, <em>ppar=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.makeSpatialGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculates the spatial grid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>crd_sys</strong> : {&#8216;sph&#8217;,&#8217;car&#8217;}</p>
<blockquote>
<div><p>Coordinate system of the spatial grid</p>
</div></blockquote>
<p><strong>xbound</strong> : list</p>
<blockquote>
<div><p>(with at least two elements) of boundaries for the grid along the first dimension</p>
</div></blockquote>
<p><strong>ybound</strong> : list</p>
<blockquote>
<div><p>(with at least two elements) of boundaries for the grid along the second dimension</p>
</div></blockquote>
<p><strong>zbound</strong> : list</p>
<blockquote>
<div><p>(with at least two elements) of boundaries for the grid along the third dimension</p>
</div></blockquote>
<p><strong>nxi</strong> : int</p>
<blockquote>
<div><p>Number of grid points along the first dimension. List with len(xbound)-1 elements with
nxi[i] being the number of grid points between xbound[i] and xbound[i+1]</p>
</div></blockquote>
<p><strong>nyi</strong> : int</p>
<blockquote>
<div><p>Same as nxi but for the second dimension</p>
</div></blockquote>
<p><strong>nzi</strong> : int</p>
<blockquote>
<div><p>Same as nxi but for the third dimension</p>
</div></blockquote>
<p><strong>ppar</strong> : Dictionary containing all input parameters of the model (from the problem_params.inp file)</p>
<blockquote class="last">
<div><p>if ppar is set all keyword arguments that are not set will be taken from this dictionary</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.makeWavelengthGrid">
<code class="descname">makeWavelengthGrid</code><span class="sig-paren">(</span><em>wbound=None</em>, <em>nw=None</em>, <em>ppar=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.makeWavelengthGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates the wavelength/frequency grid.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>wbound</strong> : list</p>
<blockquote>
<div><p>Contains the wavelength boundaries of the wavelength grid (should contain at least two elements)</p>
</div></blockquote>
<p><strong>nw</strong> : list</p>
<blockquote>
<div><p>Contains len(wbound)-1 elements containing the number of wavelengths between the bounds
set by wbound</p>
</div></blockquote>
<p><strong>ppar</strong> : dictionary, optional</p>
<blockquote class="last">
<div><p>Contains all input parameters with the parameter names as keys</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.readGrid">
<code class="descname">readGrid</code><span class="sig-paren">(</span><em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.readGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the spatial (amr_grid.inp) and frequency grid (wavelength_micron.inp).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.readSpatialGrid">
<code class="descname">readSpatialGrid</code><span class="sig-paren">(</span><em>fname=''</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.readSpatialGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the spatial grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name from which the spatial grid should be read. If omitted &#8216;amr_grid.inp&#8217; will be used.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.readWavelengthGrid">
<code class="descname">readWavelengthGrid</code><span class="sig-paren">(</span><em>fname=None</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.readWavelengthGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the wavelength grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name from which the spatial grid should be read. If omitted &#8216;wavelength_micron.inp&#8217; will be used.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.writeSpatialGrid">
<code class="descname">writeSpatialGrid</code><span class="sig-paren">(</span><em>fname=''</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.writeSpatialGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the wavelength grid to a file (e.g. amr_grid.inp).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name into which the spatial grid should be written. If omitted &#8216;amr_grid.inp&#8217; will be used.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.reggrid.radmc3dGrid.writeWavelengthGrid">
<code class="descname">writeWavelengthGrid</code><span class="sig-paren">(</span><em>fname=''</em>, <em>old=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.reggrid.radmc3dGrid.writeWavelengthGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Wriites the wavelength grid to a file (e.g. wavelength_micron.inp).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str, optional</p>
<blockquote>
<div><p>File name into which the wavelength grid should be written. If omitted &#8216;wavelength_micron.inp&#8217;
will be used</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If set to True the file format of the previous, 2D version of radmc will be used</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.setup">
<span id="radmc3dpy-setup-module"></span><h2>radmc3dPy.setup module<a class="headerlink" href="#module-radmc3dPy.setup" title="Permalink to this headline">¶</a></h2>
<p>This module contains functions to set up a RADMC-3D model for dust and/or line simulations.
For help on the syntax or functionality of each function see the help of the individual functions</p>
<dl class="function">
<dt id="radmc3dPy.setup.problemSetupDust">
<code class="descclassname">radmc3dPy.setup.</code><code class="descname">problemSetupDust</code><span class="sig-paren">(</span><em>model=None</em>, <em>binary=True</em>, <em>writeDustTemp=False</em>, <em>old=False</em>, <em>dfunc=None</em>, <em>dfpar=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.problemSetupDust" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to set up a dust model for RADMC-3D</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote>
<div><p>Name of the model that should be used to create the density structure.
The file should be in a directory from where it can directly be imported 
(i.e. the directory should be in the PYTHON_PATH environment variable or
it should be in the current working directory)
and the file name should be &#8216;model_xxx.py&#8217;, where xxx stands for the string
that should be specified in this variable</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote>
<div><p>If True input files will be written in binary format, if False input files are
written as formatted ascii text.</p>
</div></blockquote>
<p><strong>writeDustTemp</strong> : bool, optional</p>
<blockquote>
<div><p>If True a separate dust_temperature.inp/dust_tempearture.binp file will be
written under the condition that the model contains a function getDustTemperature()</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the input files for the old 2D version of radmc will be created</p>
</div></blockquote>
<p><strong>dfunc</strong> : function, optional</p>
<blockquote>
<div><p>Decision function for octree-like amr tree building. It should take linear arrays of 
cell centre coordinates (x,y,z) and cell half-widhts (dx,dy,dz) in all three dimensions,
a radmc3d model, a dictionary with all parameters from problem_params.inp and an other 
keyword argument (<a href="#id5"><span class="problematic" id="id6">**</span></a>kwargs). It should return a boolean ndarray of the same length as 
the input coordinates containing True if the cell should be resolved and False if not. 
An example for the implementation of such decision function can be found in radmc3dPy.analyze
module (radmc3dPy.analyze.gdensMinMax()).</p>
</div></blockquote>
<p><strong>dfpar</strong> : dictionary</p>
<blockquote>
<div><p>Dicionary of keyword arguments to be passed on to dfunc. These parameters will not be written
to problem_params.inp. Parameters can also be passed to dfunc via normal keyword arguments 
gathered in <a href="#id7"><span class="problematic" id="id8">**</span></a>kwargs, however all keyword arguments in <a href="#id9"><span class="problematic" id="id10">**</span></a>kwargs will be written to 
problem_params.inp</p>
</div></blockquote>
<p><strong>**kwargs</strong> : Any varible name in problem_params.inp can be used as a keyword argument.</p>
<blockquote class="last">
<div><p>At first all variables are read from problem_params.in to a dictionary called ppar. Then 
if there is any keyword argument set in the call of problem_setup_dust the ppar dictionary 
is searched for this key. If found the value belonging to that key in the ppar dictionary 
is changed to the value of the keyword argument. If no such key is found then the dictionary 
is simply extended by the keyword argument. Finally the problem_params.inp file is updated
with the new parameter values.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Files written by problemSetupDust() for RADMC-3D</p>
<blockquote>
<div><ul class="simple">
<li>dustopac.inp             : Dust opacity master file.</li>
<li>wavelength_micron.inp    : Wavelength grid.</li>
<li>amr_grid.inp             : Spatial grid.</li>
<li>stars.inp                : Input radiation field (discrete stellar sources).</li>
<li>stellarsrc_density.inp   : Input radiation field (continuous stellar sources).</li>
<li>stellarsrc_templates.inp : Input radiation field (continuous stellar sources).</li>
<li>dust_density.inp         : Dust density distribution.</li>
<li>radmc3d.inp              : Parameters for RADMC-3D (e.g. Nr of photons to be used, scattering type, etc).</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.setup.problemSetupGas">
<code class="descclassname">radmc3dPy.setup.</code><code class="descname">problemSetupGas</code><span class="sig-paren">(</span><em>model=None</em>, <em>fullsetup=False</em>, <em>binary=True</em>, <em>writeGasTemp=False</em>, <em>dfunc=None</em>, <em>dfpar=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.problemSetupGas" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to set up a gas model for RADMC-3D</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote>
<div><p>Name of the model that should be used to create the density structure
the file should be in a directory from where it can directly be imported 
(i.e. the directory should be in the PYTHON_PATH environment variable, or
it should be the current working directory)
and the file name should be &#8216;MODELNAME.py&#8217;, where MODELNAME stands for the string
that should be specified in this variable</p>
</div></blockquote>
<p><strong>fullsetup</strong> : bool, optional</p>
<blockquote>
<div><p>If False only the files related to the gas simulation is written out
(i.e. no grid, stellar parameter file and radmc3d master command file is written)
assuming that these files have already been created for a previous continuum simulation.
If True the spatial and wavelength grid as well as the input radiation field
and the radmc3d master command file will be (over)written.</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote>
<div><p>If True input files will be written in binary format, if False input files are
written as formatted ascii text.</p>
</div></blockquote>
<p><strong>writeGasTemp</strong> : bool, optional</p>
<blockquote>
<div><p>If True a separate gas_temperature.inp/gas_tempearture.binp file will be
written under the condition that the model contains a function get_gas_temperature()</p>
</div></blockquote>
<p><strong>dfunc</strong> : function, optional</p>
<blockquote>
<div><p>Decision function for octree-like amr tree building. It should take linear arrays of 
cell centre coordinates (x,y,z) and cell half-widhts (dx,dy,dz) in all three dimensions,
a radmc3d model, a dictionary with all parameters from problem_params.inp and an other 
keyword argument (<a href="#id11"><span class="problematic" id="id12">**</span></a>kwargs). It should return a boolean ndarray of the same length as 
the input coordinates containing True if the cell should be resolved and False if not. 
An example for the implementation of such decision function can be found in radmc3dPy.analyze
module (radmc3dPy.analyze.gdensMinMax()).</p>
</div></blockquote>
<p><strong>dfpar</strong> : dictionary</p>
<blockquote>
<div><p>Dicionary of keyword arguments to be passed on to dfunc. These parameters will not be written
to problem_params.inp. Parameters can also be passed to dfunc via normal keyword arguments 
gathered in <a href="#id13"><span class="problematic" id="id14">**</span></a>kwargs, however all keyword arguments in <a href="#id15"><span class="problematic" id="id16">**</span></a>kwargs will be written to 
problem_params.inp</p>
</div></blockquote>
<p><strong>**kwargs</strong> : Any varible name in problem_params.inp can be used as a keyword argument.</p>
<blockquote class="last">
<div><p>At first all variables are read from problem_params.in to a dictionary called ppar. Then 
if there is any keyword argument set in the call of problem_setup_gas the ppar dictionary 
is searched for such key. If found the value belonging to that key in the ppar dictionary 
is changed to the value of the keyword argument. If no such key is found then the dictionary 
is simply extended by the keyword argument. Finally the problem_params.inp file is updated
with the new parameter values.
Any additional keyword argument for the octree AMR mesh generation should also be passed here.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Files written by problemSetupGas()</p>
<blockquote>
<div><ul class="simple">
<li>lines.inp             : Line mode master command file.</li>
<li>numberdens_xxx.inp    : Number density of molecule/atomic species &#8216;xxx&#8217;</li>
<li>gas_velocity.inp      : Gas velocity</li>
<li><dl class="first docutils">
<dt>microturbulence.inp <span class="classifier-delimiter">:</span> <span class="classifier">The standard deviation of the Gaussian line profile caused by turbulent </span></dt>
<dd>broadening.</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>gas_temperature.inp <span class="classifier-delimiter">:</span> <span class="classifier">Gas temperature (which may be different from the dust temperature). If</span></dt>
<dd>tgas_eq_tdust is set to zero in radmc3d.inp the gas temperature in this
file will be used instead of the dust temperature.</dd>
</dl>
</li>
</ul>
<p>If fullsetup is set to True the following additional files will be created</p>
<ul class="simple">
<li>amr_grid.inp          : Spatial grid.</li>
<li>wavelength_micron.inp : Wavelength grid.</li>
<li>stars.inp             : Input radiation field.</li>
<li>radmc3d.inp           : Parameters for RADMC-3D (e.g. Nr of photons to be used, scattering type, etc).</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="class">
<dt id="radmc3dPy.setup.radmc3dModel">
<em class="property">class </em><code class="descclassname">radmc3dPy.setup.</code><code class="descname">radmc3dModel</code><span class="sig-paren">(</span><em>model=None</em>, <em>binary=None</em>, <em>old=False</em>, <em>dfunc=None</em>, <em>dfpar=None</em>, <em>parfile_update=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote>
<div><p>Name of the model that should be used to create the density structure.
The file should be in a directory from where it can directly be imported
(i.e. the directory should be in the PYTHON_PATH environment variable or
it should be in the current working directory)
and the file name should be &#8216;model_xxx.py&#8217;, where xxx stands for the string
that should be specified in this variable</p>
</div></blockquote>
<p><strong>binary</strong> : bool, optional</p>
<blockquote>
<div><p>If True input files will be written in binary format, if False input files are
written as formatted ascii text.</p>
</div></blockquote>
<p><strong>old</strong> : bool, optional</p>
<blockquote>
<div><p>If set to True the input files for the old 2D version of radmc will be created</p>
</div></blockquote>
<p><strong>dfunc</strong> : function, optional</p>
<blockquote>
<div><p>Decision function for octree-like amr tree building. It should take linear arrays of
cell centre coordinates (x,y,z) and cell half-widhts (dx,dy,dz) in all three dimensions,
a radmc3d model, a dictionary with all parameters from problem_params.inp and an other
keyword argument (<a href="#id17"><span class="problematic" id="id18">**</span></a>kwargs). It should return a boolean ndarray of the same length as
the input coordinates containing True if the cell should be resolved and False if not.
An example for the implementation of such decision function can be found in radmc3dPy.analyze
module (radmc3dPy.analyze.gdensMinMax()).</p>
</div></blockquote>
<p><strong>dfpar</strong> : dictionary</p>
<blockquote>
<div><p>Dicionary of keyword arguments to be passed on to dfunc. These parameters will not be written
to problem_params.inp. Parameters can also be passed to dfunc via normal keyword arguments
gathered in <a href="#id19"><span class="problematic" id="id20">**</span></a>kwargs, however all keyword arguments in <a href="#id21"><span class="problematic" id="id22">**</span></a>kwargs will be written to
problem_params.inp</p>
</div></blockquote>
<p><strong>parfile_update</strong> : bool</p>
<blockquote>
<div><p>If True the parameter file (problem_params.inp) will be updated / overwritten with any parameters
that are possibly passed as keyword arguments. For False the problem_params.inp file will not be
overwritten irrespectively of the parameter values the data members of the radmc3dModel instance
would contain.</p>
</div></blockquote>
<p><strong>Keyword Arguments  :</strong></p>
<blockquote class="last">
<div><p>Any varible name in problem_params.inp can be used as a keyword argument.
At first all variables are read from problem_params.in to a dictionary called ppar. Then
if there is any keyword argument set in the call of problem_setup_dust the ppar dictionary
is searched for this key. If found the value belonging to that key in the ppar dictionary
is changed to the value of the keyword argument. If no such key is found then the dictionary
is simply extended by the keyword argument. Finally the problem_params.inp file is updated
with the new parameter values.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Attributes</p>
<table border="1" class="docutils">
<colgroup>
<col width="6%" />
<col width="94%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>binary</td>
<td>(bool) If True, it sets the data file format to binary (overwriting also the rto_style parameter!), if False the file format will be formatted ascii</td>
</tr>
<tr class="row-even"><td>data</td>
<td>(radmc3dData) Container for physical variables in the mode</td>
</tr>
<tr class="row-odd"><td>grid</td>
<td>(radmc3dGrid) Container for spatial and wavelength grid</td>
</tr>
<tr class="row-even"><td>model</td>
<td>(str) Name of the model that has callable functions to generate physical variables for the model</td>
</tr>
<tr class="row-odd"><td>old</td>
<td>(bool) If True the model is meant to be for radmc, the pre-decessor code of radmc-3d.</td>
</tr>
<tr class="row-even"><td>opac</td>
<td>(radmc3dOpac) Container for dust opacities</td>
</tr>
<tr class="row-odd"><td>par</td>
<td>(radmc3dPar) Container for the parameters of the model (i.e. the content of the problem_params.inp file)</td>
</tr>
<tr class="row-even"><td>radsources</td>
<td>(radmc3dRadsources) Container for the radiation sources in the model</td>
</tr>
</tbody>
</table>
<p class="rubric">Methods</p>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.makeDustOpac" title="radmc3dPy.setup.radmc3dModel.makeDustOpac"><code class="xref py py-obj docutils literal"><span class="pre">makeDustOpac</span></code></a>()</td>
<td>Generates dust opacities and writes them to file</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.makeGrid" title="radmc3dPy.setup.radmc3dModel.makeGrid"><code class="xref py py-obj docutils literal"><span class="pre">makeGrid</span></code></a>([sgrid,&nbsp;wgrid,&nbsp;writeToFile])</td>
<td>Generates a spatial and/or wavelength grid</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.makeRadSources" title="radmc3dPy.setup.radmc3dModel.makeRadSources"><code class="xref py py-obj docutils literal"><span class="pre">makeRadSources</span></code></a>([writeToFile])</td>
<td><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.makeVar" title="radmc3dPy.setup.radmc3dModel.makeVar"><code class="xref py py-obj docutils literal"><span class="pre">makeVar</span></code></a>([ddens,&nbsp;dtemp,&nbsp;gdens,&nbsp;gtemp,&nbsp;gvel,&nbsp;...])</td>
<td>Generates variables and possibly writes them to file</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.readParams" title="radmc3dPy.setup.radmc3dModel.readParams"><code class="xref py py-obj docutils literal"><span class="pre">readParams</span></code></a>()</td>
<td></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.setupDust" title="radmc3dPy.setup.radmc3dModel.setupDust"><code class="xref py py-obj docutils literal"><span class="pre">setupDust</span></code></a>([sgrid,&nbsp;wgrid,&nbsp;radsources,&nbsp;...])</td>
<td>Set up a model for RADMC-3D.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.setupGas" title="radmc3dPy.setup.radmc3dModel.setupGas"><code class="xref py py-obj docutils literal"><span class="pre">setupGas</span></code></a>([sgrid,&nbsp;wgrid,&nbsp;radsources,&nbsp;gdens,&nbsp;...])</td>
<td>Set up a model for RADMC-3D.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.writeLinesInp" title="radmc3dPy.setup.radmc3dModel.writeLinesInp"><code class="xref py py-obj docutils literal"><span class="pre">writeLinesInp</span></code></a>()</td>
<td>Writes the lines.inp master command file for line simulation in RADMC-3D</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="#radmc3dPy.setup.radmc3dModel.writeRadmc3dInp" title="radmc3dPy.setup.radmc3dModel.writeRadmc3dInp"><code class="xref py py-obj docutils literal"><span class="pre">writeRadmc3dInp</span></code></a>()</td>
<td>Writes the radmc3d.inp master command file for RADMC-3D</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.makeDustOpac">
<code class="descname">makeDustOpac</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.makeDustOpac" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates dust opacities and writes them to file</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.makeGrid">
<code class="descname">makeGrid</code><span class="sig-paren">(</span><em>sgrid=True</em>, <em>wgrid=True</em>, <em>writeToFile=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.makeGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates a spatial and/or wavelength grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>wgrid</strong> : bool</p>
<blockquote>
<div><p>Set to True to generate the wavelength grid</p>
</div></blockquote>
<p><strong>sgrid</strong> : bool</p>
<blockquote>
<div><p>Set to True to generate the spatial grid</p>
</div></blockquote>
<p><strong>writeToFile</strong> : bool</p>
<blockquote>
<div><p>If True the grid will be written to amr_grid.inp and/or wavelength_micron.inp</p>
</div></blockquote>
<p><strong>**kwargs</strong> : Any varible name in problem_params.inp can be used as a keyword argument.</p>
<blockquote class="last">
<div><p>At first all variables are read from problem_params.in to a dictionary called ppar. Then
if there is any keyword argument set in the call of problem_setup_dust the ppar dictionary
is searched for this key. If found the value belonging to that key in the ppar dictionary
is changed to the value of the keyword argument. If no such key is found then the dictionary
is simply extended by the keyword argument. Finally the problem_params.inp file is updated
with the new parameter values.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.makeRadSources">
<code class="descname">makeRadSources</code><span class="sig-paren">(</span><em>writeToFile=True</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.makeRadSources" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>writeToFile</strong> : bool</p>
<blockquote class="last">
<div><p>If True the radiation will be written to stars.inp and or stellarsrc_density.inp,
stellarsrc_templates.inp</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.makeVar">
<code class="descname">makeVar</code><span class="sig-paren">(</span><em>ddens=False</em>, <em>dtemp=False</em>, <em>gdens=False</em>, <em>gtemp=False</em>, <em>gvel=False</em>, <em>vturb=False</em>, <em>writeToFile=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.makeVar" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates variables and possibly writes them to file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ddens</strong> : bool, optional</p>
<blockquote>
<div><p>If True generates the dust density</p>
</div></blockquote>
<p><strong>dtemp</strong> : bool, optional</p>
<blockquote>
<div><dl class="docutils">
<dt>If True generates the dust temperature (normally this would be calculated by RADMC-3D, but</dt>
<dd><p class="first last">in some cases, e.g. debugging, it might come handy)</p>
</dd>
</dl>
</div></blockquote>
<p><strong>gdens</strong> : bool, optional</p>
<blockquote>
<div><p>If True generates the gas density</p>
</div></blockquote>
<p><strong>gtemp</strong> : bool, optional</p>
<blockquote>
<div><p>If True generates the gas temperature</p>
</div></blockquote>
<p><strong>gvel</strong> : bool, optional</p>
<blockquote>
<div><p>If True generates the gas velocity</p>
</div></blockquote>
<p><strong>vturb</strong> : bool, optional</p>
<blockquote>
<div><p>If True generates the microturbulent velocity field</p>
</div></blockquote>
<p><strong>writeToFile</strong> : bool, optional</p>
<blockquote class="last">
<div><p>If True the generated variable(s) will be written to file</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.readParams">
<code class="descname">readParams</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.readParams" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.setupDust">
<code class="descname">setupDust</code><span class="sig-paren">(</span><em>sgrid=True</em>, <em>wgrid=True</em>, <em>radsources=True</em>, <em>dustopac=True</em>, <em>ddens=True</em>, <em>dtemp=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.setupDust" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a model for RADMC-3D.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>sgrid</strong> : bool</p>
<blockquote>
<div><p>Should the spatial grid be generated? (default=True)</p>
</div></blockquote>
<p><strong>wgrid</strong> : bool</p>
<blockquote>
<div><p>Should the wavelength grid be generated? (default=True)</p>
</div></blockquote>
<p><strong>radsources</strong> : bool</p>
<blockquote>
<div><p>Should the radiation sources be generated? (default=True)</p>
</div></blockquote>
<p><strong>dustopac</strong> : bool</p>
<blockquote>
<div><p>Should dust opacities be generated? (default=True)</p>
</div></blockquote>
<p><strong>ddens</strong> : bool</p>
<blockquote>
<div><p>Should the dust density be generated? (default=True)</p>
</div></blockquote>
<p><strong>dtemp</strong> : bool</p>
<blockquote>
<div><p>Should the dust temperature be generated (default=False)</p>
</div></blockquote>
<p><strong>Note, that by default all generated data will be written to files immediately. In case you wish to generate</strong></p>
<blockquote class="last">
<div><p>the files but not write the data to files but only keep them instead in data attributes, please use the
individual generator functions methods (e.g. makeGrid, makeRadSources, makeVar, etc)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.setupGas">
<code class="descname">setupGas</code><span class="sig-paren">(</span><em>sgrid=False</em>, <em>wgrid=False</em>, <em>radsources=False</em>, <em>gdens=True</em>, <em>gtemp=True</em>, <em>gvel=True</em>, <em>vturb=True</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.setupGas" title="Permalink to this definition">¶</a></dt>
<dd><p>Set up a model for RADMC-3D.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>sgrid</strong> : bool</p>
<blockquote>
<div><p>Should the spatial grid be generated? (default=False)</p>
</div></blockquote>
<p><strong>wgrid</strong> : bool</p>
<blockquote>
<div><p>Should the wavelength grid be generated? (default=False)</p>
</div></blockquote>
<p><strong>radsources</strong> : bool</p>
<blockquote>
<div><p>Should the radiation sources be generated? (default=False)</p>
</div></blockquote>
<p><strong>gdens</strong> : bool</p>
<blockquote>
<div><p>Should the gas density be generated? (default=True)</p>
</div></blockquote>
<p><strong>gtemp</strong> : bool</p>
<blockquote>
<div><p>Should the gas temperature be generated (default=False)</p>
</div></blockquote>
<p><strong>gvel</strong> : bool</p>
<blockquote>
<div><p>Should the gas veloctiy be generated (default=False)</p>
</div></blockquote>
<p><strong>vturb</strong> : bool</p>
<blockquote>
<div><p>Should the turbulent velocity field be generated (default=False)</p>
</div></blockquote>
<p><strong>Note, that by default all generated data will be written to files immediately. In case you wish to generate</strong></p>
<blockquote class="last">
<div><p>the files but not write the data to files but only keep them instead in data attributes, please use the
individual generator functions methods (e.g. makeGrid, makeRadSources, makeVar, etc)</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.writeLinesInp">
<code class="descname">writeLinesInp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.writeLinesInp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the lines.inp master command file for line simulation in RADMC-3D</p>
</dd></dl>

<dl class="method">
<dt id="radmc3dPy.setup.radmc3dModel.writeRadmc3dInp">
<code class="descname">writeRadmc3dInp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.radmc3dModel.writeRadmc3dInp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the radmc3d.inp master command file for RADMC-3D</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="radmc3dPy.setup.validateModel">
<code class="descclassname">radmc3dPy.setup.</code><code class="descname">validateModel</code><span class="sig-paren">(</span><em>model=''</em>, <em>dustModel=False</em>, <em>gasModel=False</em>, <em>writeDustTemp=False</em>, <em>octree=False</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.validateModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Function to validate a model. It checks three things: 1) whether or not the model can be imported,
2) whether the model has all the function to be used as dust and/or gas model, 3) if it has the right
number of arguments. The function names tested are getDefaultParams, getDustDensity, getGasDensity, 
getGasAbundance, getVTurb, getVelocity, getDustTempearture (optional).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>model</strong> : str</p>
<blockquote>
<div><p>Name of the model to be tested</p>
</div></blockquote>
<p><strong>dustModel</strong> : bool</p>
<blockquote>
<div><p>If True the existence of functions getDustDensity() and getDustTemperature() will be checked.
The latter is only checked if writeDustTemp is set to True.</p>
</div></blockquote>
<p><strong>gasModel</strong> : bool</p>
<blockquote>
<div><p>If True the existence of functions getGasDensity(), getGasAbundance(), getVTurb(), getVelocity()
will be checked.</p>
</div></blockquote>
<p><strong>writeDustTemp: bool</strong></p>
<blockquote>
<div><p>If True the existence of the function getDustTemperature() will be checked.</p>
</div></blockquote>
<p><strong>octree</strong> : bool</p>
<blockquote>
<div><p>If True the number of argument of the model functions will be checked. For regular grids only two 
arguments should be present for the grid instance and for the parameter dictionary (grid, ppar). 
For a model to be used with octree AMR three additional arguments for the three spatial coordiantes
(x,y,z) should be present. The argument sequence should then be x, y, z, grid, ppar.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A boolean True if the model is valid and False if it is not.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.setup.writeLinesInp">
<code class="descclassname">radmc3dPy.setup.</code><code class="descname">writeLinesInp</code><span class="sig-paren">(</span><em>ppar=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.writeLinesInp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the lines.inp master command file for line simulation in RADMC-3D</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>ppar</strong> : dictionary,</p>
<blockquote class="last">
<div><p>Contains all parameters of a RADMC-3D run</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.setup.writeRadmc3dInp">
<code class="descclassname">radmc3dPy.setup.</code><code class="descname">writeRadmc3dInp</code><span class="sig-paren">(</span><em>modpar=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.writeRadmc3dInp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the radmc3d.inp master command file for RADMC-3D</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>modpar</strong> : radmc3dPar</p>
<blockquote class="last">
<div><p>Contains all parameters of a RADMC-3D run.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.setup.writeRadmcInp">
<code class="descclassname">radmc3dPy.setup.</code><code class="descname">writeRadmcInp</code><span class="sig-paren">(</span><em>modpar=None</em>, <em>nphot=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.setup.writeRadmcInp" title="Permalink to this definition">¶</a></dt>
<dd><p>Writes the radmc.inp master command file for the 2D version of radmc</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>modpar</strong> : radmc3dPar</p>
<blockquote>
<div><p>Contains all parameters of a radmc run.</p>
</div></blockquote>
<p><strong>nphot</strong> : int</p>
<blockquote class="last">
<div><p>Number of photons used for the MC simulation</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-radmc3dPy.staratm">
<span id="radmc3dpy-staratm-module"></span><h2>radmc3dPy.staratm module<a class="headerlink" href="#module-radmc3dPy.staratm" title="Permalink to this headline">¶</a></h2>
<p>This module contains functions to get various radiation sources in RADMC-3D.
For help on the syntax or functionality of each function see the help of the individual functions</p>
<dl class="function">
<dt id="radmc3dPy.staratm.getAtmModel">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">getAtmModel</code><span class="sig-paren">(</span><em>teff=0.0</em>, <em>logg=None</em>, <em>mstar=None</em>, <em>lstar=None</em>, <em>rstar=None</em>, <em>iwav=None</em>, <em>model='kurucz'</em>, <em>modeldir=None</em>, <em>wmax=7.0</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.getAtmModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolates the stellar model atmosphere on a pre-defined wavelength grid
The model atmospheres are interpolated in logg and Teff and rebinned in wavelength 
to the input wavelength grid and scaled to have the same luminosity as specified</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>teff</strong> : float</p>
<blockquote>
<div><p>Effective temperature of the star</p>
</div></blockquote>
<p><strong>logg</strong> : float</p>
<blockquote>
<div><p>Logarithm of the surface gravity of the star</p>
</div></blockquote>
<p><strong>mstar</strong> : float</p>
<blockquote>
<div><p>Mass of the star in gramm</p>
</div></blockquote>
<p><strong>lstar</strong> : float, optional</p>
<blockquote>
<div><p>Luminosity of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>rstar</strong> : float, optional</p>
<blockquote>
<div><p>Radius of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>iwav</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid for which the stellar atmosphere model should be calculated</p>
</div></blockquote>
<p><strong>model</strong> : {&#8216;kurucz&#8217;, &#8216;nextgen&#8217;, &#8216;ames-dusty&#8217;}</p>
<blockquote>
<div><p>Name of the model atmosphere family</p>
</div></blockquote>
<p><strong>modeldir</strong> : str</p>
<blockquote>
<div><p>Path to the atmosphere models</p>
</div></blockquote>
<p><strong>wmax</strong> : float</p>
<blockquote>
<div><p>Maximum wavelength until the model atmosphere is used on the interpolated grid
Longwards of this wavelength the Rayleigh-Jeans approximation (lambda^(-2)) is used.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron (same as the input iwav keyword)</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>lnu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of the stellar atmosphere in erg/s/Hz</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.getSpectrumAmesDusty">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">getSpectrumAmesDusty</code><span class="sig-paren">(</span><em>teff=None</em>, <em>logg=None</em>, <em>mstar=None</em>, <em>lstar=None</em>, <em>rstar=None</em>, <em>modeldir=None</em>, <em>wav=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.getSpectrumAmesDusty" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolates the Ames-Dusty model atmospheres in logg and Teff</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>teff</strong> : float</p>
<blockquote>
<div><p>Effective temperature of the star</p>
</div></blockquote>
<p><strong>logg</strong> : float</p>
<blockquote>
<div><p>Logarithm of the surface gravity of the star</p>
</div></blockquote>
<p><strong>mstar</strong> : float, optional</p>
<blockquote>
<div><p>Stellar mass in g (either logg or mstar and rstar should be specified)</p>
</div></blockquote>
<p><strong>lstar</strong> : float, optional</p>
<blockquote>
<div><p>Luminosity of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>rstar</strong> : float, optional</p>
<blockquote>
<div><p>Radius of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>modeldir</strong> : str</p>
<blockquote>
<div><p>Path to the AmesDusty atmosphere model grid</p>
</div></blockquote>
<p><strong>wav</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid for which the stellar atmosphere model should be calculated</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron (same as the input wav keyword)</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>lnu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of the stellar atmosphere in erg/s/Hz</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>bnu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of a blackbody stellar atmosphere with the same luminosity and
effective temperature as the stellar model in erg/s/Hz</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.getSpectrumKurucz">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">getSpectrumKurucz</code><span class="sig-paren">(</span><em>teff=None</em>, <em>logg=None</em>, <em>mstar=None</em>, <em>lstar=None</em>, <em>rstar=None</em>, <em>modeldir=None</em>, <em>wav=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.getSpectrumKurucz" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolates the Kurucz model atmospheres in logg and Teff</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>teff</strong> : float</p>
<blockquote>
<div><p>Effective temperature of the star</p>
</div></blockquote>
<p><strong>logg</strong> : float</p>
<blockquote>
<div><p>Logarithm of the surface gravity of the star</p>
</div></blockquote>
<p><strong>mstar</strong> : float, optional</p>
<blockquote>
<div><p>Stellar mass in g (either logg or mstar and rstar should be specified)</p>
</div></blockquote>
<p><strong>lstar</strong> : float, optional</p>
<blockquote>
<div><p>Luminosity of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>rstar</strong> : float, optional</p>
<blockquote>
<div><p>Radius of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>modeldir</strong> : str</p>
<blockquote>
<div><p>Path to the Kurucz atmosphere model grid</p>
</div></blockquote>
<p><strong>wav</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid for which the stellar atmosphere model should be calculated</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron (same as the input wav keyword)</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>lnu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of the stellar atmosphere in erg/s/Hz</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>lnucont <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of the continuum stellar atmosphere in erg/s/Hz</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.getSpectrumNextGen">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">getSpectrumNextGen</code><span class="sig-paren">(</span><em>teff=None</em>, <em>logg=None</em>, <em>mstar=None</em>, <em>lstar=None</em>, <em>rstar=None</em>, <em>modeldir=None</em>, <em>wav=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.getSpectrumNextGen" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolates the NextGen model atmospheres in logg and Teff</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>teff</strong> : float</p>
<blockquote>
<div><p>Effective temperature of the star</p>
</div></blockquote>
<p><strong>logg</strong> : float</p>
<blockquote>
<div><p>Logarithm of the surface gravity of the star</p>
</div></blockquote>
<p><strong>mstar</strong> : float, optional</p>
<blockquote>
<div><p>Stellar mass in g (either logg or mstar and rstar should be specified)</p>
</div></blockquote>
<p><strong>lstar</strong> : float, optional</p>
<blockquote>
<div><p>Luminosity of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>rstar</strong> : float, optional</p>
<blockquote>
<div><p>Radius of the star (either lstar or rstar should be specified)</p>
</div></blockquote>
<p><strong>modeldir</strong> : str</p>
<blockquote>
<div><p>Path to the NextGen atmosphere model grid</p>
</div></blockquote>
<p><strong>wav</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid for which the stellar atmosphere model should be calculated</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron (same as the input wav keyword)</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>lnu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of the stellar atmosphere in erg/s/Hz</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>bnu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Monochromatic luminosity of a blackbody stellar atmosphere with the same luminosity and
effective temperature as the stellar model in erg/s/Hz</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.readAmesDustySpectrum">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">readAmesDustySpectrum</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.readAmesDustySpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the Ames-Dusty model atmosphere</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>File name containing the Ames-Dusty model atmosphere (e.g. lte30-3.5-0.0.AMES-dusty.7)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>nwav <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Number of wavelength points</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>inu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Specific intensity of the stellar model atmosphere in erg/s/cm/cm/Hz/ster</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>bnu <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Specific intensity of a blackbody stellar model atmosphere with the same luminosity
and the same effective temperature in erg/s/cm/cm/Hz/ster</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>teff <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Effective temperature of the model</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>logg <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Logarithm of the surface gravity of the model</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>mph <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Metallicity of the atmosphere model</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.readKuruczGrid">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">readKuruczGrid</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.readKuruczGrid" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the Kurucz model atmosphere grid. It reads a whole file from the Kurucz grid that contains
a 2D grid of atmosphere models for Teff and logg.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>File name containing the Kurucz model atmosphere (e.g. fp00k2.pck)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>nwav <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Number of wavelength points</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>inu <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Each element of the list contains an ndarray with the specific intensity of the stellar 
model atmosphere in erg/s/cm/cm/Hz/ster</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>inucont <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Each element of the list contains an ndarray with the specific intensity of the stellar 
model atmosphere continuum in erg/s/cm/cm/Hz/ster</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>teff <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Contains the Teff grid of the model grid</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>logg <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Contains the logg grid of the model grid</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.readNextGenSpectrum">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">readNextGenSpectrum</code><span class="sig-paren">(</span><em>fname=''</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.readNextGenSpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads the NextGen model atmosphere.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>fname</strong> : str</p>
<blockquote>
<div><p>File name containing the NextGen model atmosphere (e.g. nlte98-4.5-2.5.NextGen.spec)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Returns a dictionary with the following keys:</p>
<blockquote class="last">
<div><ul class="simple">
<li><dl class="first docutils">
<dt>wav <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Wavelength in micron</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>nwav <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
<dd>Number of wavelength points</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>inu <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd>Specific intensity of the stellar model atmosphere in erg/s/cm/cm/Hz/ster</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>bnu <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd>Specific intensity of a blackbody stellar model atmosphere with the same luminosity
and the same effective temperature in erg/s/cm/cm/Hz/ster</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>teff <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Effective temperature of the model</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>logg <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Logarithm of the surface gravity of the model</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>mph <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Metallicity of the atmosphere model</dd>
</dl>
</li>
</ul>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="radmc3dPy.staratm.rebinSpectrum">
<code class="descclassname">radmc3dPy.staratm.</code><code class="descname">rebinSpectrum</code><span class="sig-paren">(</span><em>wav=None</em>, <em>fnu=None</em>, <em>iwav=None</em><span class="sig-paren">)</span><a class="headerlink" href="#radmc3dPy.staratm.rebinSpectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Rebins the spectrum to a coarser wavelength grid</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>wav</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid of the spectrum to be rebinned</p>
</div></blockquote>
<p><strong>fnu</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength dependent spectrum (e.g. specific intensity, monochromatic luminosity etc) to be rebbinned</p>
</div></blockquote>
<p><strong>iwav</strong> : ndarray</p>
<blockquote>
<div><p>Wavelength grid onto which the spectrum should be rebinned (it is assumed to be logarithmically spaced)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Returns an ndarray containing the spectrum rebinned to the input wavelength grid</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-radmc3dPy">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-radmc3dPy" title="Permalink to this headline">¶</a></h2>
<p>RADMC-3D Python module
(c) Attila Juhasz, 2011-2018</p>
</div>
</div>


           </div>
           <div class="articleComments">
            
           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2014-2018, Attila Juhasz.
      Last updated on Nov 19, 2018.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'0.30.2',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>